Skip to content

Commit

Permalink
Merge pull request #1022 from RotherOSS/issue-#760-satisfy_more_policies
Browse files Browse the repository at this point in the history
Issue #760 satisfy more policies
  • Loading branch information
bschmalhofer authored May 25, 2021
2 parents 38682a6 + 8adeba9 commit ee37050
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 71 deletions.
3 changes: 1 addition & 2 deletions Kernel/Modules/AgentElasticsearchQuickResult.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# --

## nofilter(TidyAll::Plugin::OTOBO::Perl::DBObject)
package Kernel::Modules::AgentElasticsearchQuickResult;
## nofilter(TidyAll::Plugin::OTRS::Perl::DBObject)
## nofilter(TidyAll::Plugin::OTOBO::Perl::DBObject)

use strict;
use warnings;
Expand Down
1 change: 1 addition & 0 deletions Kernel/System/Calendar/Event/Transport/Email.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package Kernel::System::Calendar::Event::Transport::Email;
## nofilter(TidyAll::Plugin::OTOBO::Perl::LayoutObject)
## TODO: decide whether (TidyAll::Plugin::OOTOBO::Perl::ParamObject) should be filtered, see issue rotheross/CodePolicy:#44

use strict;
use warnings;
Expand Down
7 changes: 4 additions & 3 deletions Kernel/System/MigrateFromOTRS/OTOBOPackageSpecifics.pm
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ our @ObjectDependencies = (
'Kernel::System::DateTime',
'Kernel::System::FAQ',
'Kernel::System::Package',
'Kernel::System::Console::Command::Maint::ITSM::Configitem::DefinitionPerl2YAML',
);

=head1 NAME
Expand Down Expand Up @@ -82,7 +83,7 @@ sub Run {
Result => 'Changed path of inline images.',
Sub => \&_FAQ_InlineImg,
},
{
{
Package => 'ITSMConfigurationManagement',
Description => 'Change ConfigItem definition from perl to yaml.',
Result => 'Changed ConfigItem definition from perl to yaml.',
Expand Down Expand Up @@ -199,13 +200,13 @@ sub _ITSM_ChangeDefinition {
my ( $Self, %Param ) = @_;

my $CommandObject = $Kernel::OM->Get('Kernel::System::Console::Command::Maint::ITSM::Configitem::DefinitionPerl2YAML');
my $Success = 0;
my $Success = 0;

my ( $Result, $ExitCode );

{
local *STDOUT;
open STDOUT, '>:utf8', \$Result; ## no critic qw(InputOutput::RequireEncodingWithUTF8Layer)
open STDOUT, '>:utf8', \$Result; ## no critic qw(OTOBO::ProhibitOpen InputOutput::RequireEncodingWithUTF8Layer)
$ExitCode = $CommandObject->Execute();
}

Expand Down
36 changes: 18 additions & 18 deletions Kernel/System/Package.pm
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ sub RepositoryAdd {
. Translatable('not installed') . '\', '
. ' current_timestamp, 1, current_timestamp, 1)',
Bind => [
\$Structure{Name}->{Content}, \$Structure{Version}->{Content},
\$Structure{Name}->{Content}, \$Structure{Version}->{Content},
\$Structure{Vendor}->{Content}, \$FileName, \$Content,
],
);
Expand Down Expand Up @@ -895,7 +895,7 @@ sub PackageUpgrade {
if ( $Structure{Version}->{Content} eq $InstalledVersion ) {
$Kernel::OM->Get('Kernel::System::Log')->Log(
Priority => 'error',
Message =>
Message =>
"Can't upgrade, package '$Structure{Name}->{Content}-$InstalledVersion' already installed!",
);

Expand All @@ -904,7 +904,7 @@ sub PackageUpgrade {
else {
$Kernel::OM->Get('Kernel::System::Log')->Log(
Priority => 'error',
Message =>
Message =>
"Can't upgrade, installed package '$InstalledVersion' is newer as '$Structure{Version}->{Content}'!",
);

Expand Down Expand Up @@ -1562,9 +1562,9 @@ sub PackageOnlineList {
if ( @Packages && !$PackageForRequestedFramework ) {
$Kernel::OM->Get('Kernel::System::Log')->Log(
Priority => 'error',
Message =>
Message =>
Translatable(
'No packages for your framework version found in this repository, it only contains packages for other framework versions.'
'No packages for your framework version found in this repository, it only contains packages for other framework versions.'
),
);
}
Expand Down Expand Up @@ -1884,7 +1884,7 @@ sub PackageVerify {
$PackageVerifyInfo = {
Description =>
Translatable(
"<p>Additional packages can enhance OTOBO with plenty of useful features. Ensure, however, that the origin of this package is trustworthy, as it can modify OTOBO in any possible way.</p>"
"<p>Additional packages can enhance OTOBO with plenty of useful features. Ensure, however, that the origin of this package is trustworthy, as it can modify OTOBO in any possible way.</p>"
),
Title =>
Translatable('Package not verified by the OTOBO community!'),
Expand All @@ -1896,7 +1896,7 @@ sub PackageVerify {
$PackageVerifyInfo = {
Description =>
Translatable(
'<p>The installation of packages which are not verified is disabled. You can activate the installation of not verified packages via the "Package::AllowNotVerifiedPackages" system configuration setting.</p>'
'<p>The installation of packages which are not verified is disabled. You can activate the installation of not verified packages via the "Package::AllowNotVerifiedPackages" system configuration setting.</p>'
),
Title =>
Translatable('Package not verified by the OTOBO community!'),
Expand Down Expand Up @@ -1976,13 +1976,13 @@ sub PackageVerify {
my $RequestResult = $CloudServiceObject->Request(%RequestParams);

# as this is the only operation an unsuccessful request means that the operation was also unsuccessful
if (!IsHashRefWithData($RequestResult)) {
if ( !IsHashRefWithData($RequestResult) ) {
if ($PackageAllowNotVerifiedPackages) {

$Self->{PackageVerifyInfo} = {
Description =>
Translatable(
"<p>Additional packages can enhance OTOBO with plenty of useful features. Ensure, however, that the origin of this package is trustworthy, as it can modify OTOBO in any possible way.</p>"
"<p>Additional packages can enhance OTOBO with plenty of useful features. Ensure, however, that the origin of this package is trustworthy, as it can modify OTOBO in any possible way.</p>"
),
Title =>
Translatable('Verification not possible (e.g. no internet connection)!'),
Expand All @@ -1994,7 +1994,7 @@ sub PackageVerify {
$Self->{PackageVerifyInfo} = {
Description =>
Translatable(
'<p>The installation of packages which are not verified is disabled. You can activate the installation of not verified packages via the "Package::AllowNotVerifiedPackages" system configuration setting.</p>'
'<p>The installation of packages which are not verified is disabled. You can activate the installation of not verified packages via the "Package::AllowNotVerifiedPackages" system configuration setting.</p>'
),
Title =>
Translatable('Verification not possible (e.g. no internet connection)!'),
Expand Down Expand Up @@ -3552,7 +3552,7 @@ sub PackageUpgradeAllIsRunning {

return (
IsRunning => $IsRunning // 0,
UpgradeStatus => $SystemData{Status} || '',
UpgradeStatus => $SystemData{Status} || '',
UpgradeSuccess => $SystemData{Success} || '',
);
}
Expand Down Expand Up @@ -3993,7 +3993,7 @@ sub _CheckPackageDepends {
if ( $Param{Name} eq $Module->{Content} && !$Param{Force} ) {
$Kernel::OM->Get('Kernel::System::Log')->Log(
Priority => 'error',
Message =>
Message =>
"Sorry, can't uninstall package $Param{Name}, "
. "because package $Local->{Name}->{Content} depends on it!",
);
Expand Down Expand Up @@ -4050,7 +4050,7 @@ sub _PackageFileCheck {

=head2 _FileInstall()
Update or create files below the OTOBO home dir or below a specified dir.
Update or create files below the OTOBO home directory or below a specified directory.
Additionally this method creates a backup if needed.
Expand All @@ -4067,12 +4067,12 @@ Return undef on failure, 1 on success.
Permission => '644', # unix file permissions
};
# File install below the OTOBO home dir
# File install below the OTOBO home directory
my $FileInstallOk = $PackageObject->_FileInstall(
File => $File,
);
# File install below a specified dir
# File install below a specified directory
my $FileInstallOk = $PackageObject->_FileInstall(
File => $File,
Home => $ExportDir
Expand Down Expand Up @@ -4108,7 +4108,7 @@ sub _FileInstall {
my $Home = $Param{Home} || $Self->{Home};

# check Home
if ( ! -e $Home ) {
if ( !-e $Home ) {
$Kernel::OM->Get('Kernel::System::Log')->Log(
Priority => 'error',
Message => "No such home directory: $Home!",
Expand Down Expand Up @@ -4193,7 +4193,7 @@ sub _FileInstall {
Permission => $Param{File}->{Permission},
);

if ( ! $FileWriteOk ) {
if ( !$FileWriteOk ) {
$Kernel::OM->Get('Kernel::System::Log')->Log(
Priority => 'error',
Message => "Sorry, can't install package because the file $RealFile can't be created.",
Expand Down Expand Up @@ -4428,7 +4428,7 @@ sub _Encode {
=head2 _PackageUninstallMerged()
ONLY CALL THIS METHOD FROM A DATABASE UPGRADING SCRIPT DURING FRAMEWORK UPDATES
OR FROM A CODEUPGRADE SECTION IN AN SOPM FILE OF A PACKAGE THAT INCLUDES A MERGED FEATURE ADDON.
OR FROM A CODE UPGRADE SECTION IN AN SOPM FILE OF A PACKAGE THAT INCLUDES A MERGED FEATURE ADD-ON.
Uninstall an already framework (or module) merged package.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package Kernel::System::Ticket::Event::NotificationEvent::Transport::Email;
## nofilter(TidyAll::Plugin::OTOBO::Perl::LayoutObject)
## TODO: decide whether (TidyAll::Plugin::OOTOBO::Perl::ParamObject) should be filtered, see issue rotheross/CodePolicy:#44

use strict;
use warnings;
Expand Down
Loading

0 comments on commit ee37050

Please sign in to comment.