From a58bfec081ac2faac46a9e019a77ded59490e208 Mon Sep 17 00:00:00 2001 From: Andreas Romeyke <andreas.romeyke@slub-dresden.de> Date: Thu, 13 Jun 2024 12:21:50 +0200 Subject: [PATCH] - improved '## no critic' to fix perlcritic warning --- lib/SLUB/LZA/TA/Command/count.pm | 2 +- lib/SLUB/LZA/TA/Command/init.pm | 2 +- lib/SLUB/LZA/TA/Command/report.pm | 8 ++++---- lib/SLUB/LZA/TA/Command/search.pm | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/SLUB/LZA/TA/Command/count.pm b/lib/SLUB/LZA/TA/Command/count.pm index 304d4a1..d2cc6a6 100644 --- a/lib/SLUB/LZA/TA/Command/count.pm +++ b/lib/SLUB/LZA/TA/Command/count.pm @@ -67,7 +67,7 @@ sub opt_spec { ); return (@global_opts, [], @local_opts); } -sub validate_args { ## no critic CognitiveComplexity::ProhibitExcessCognitiveComplexity +sub validate_args { ## no critic (CognitiveComplexity::ProhibitExcessCognitiveComplexity) my ($self, $opt, $args) = @_; SLUB::LZA::TA::common_global_validate($self, $opt, $args); # no args allowed but options! diff --git a/lib/SLUB/LZA/TA/Command/init.pm b/lib/SLUB/LZA/TA/Command/init.pm index f54af74..3247b40 100644 --- a/lib/SLUB/LZA/TA/Command/init.pm +++ b/lib/SLUB/LZA/TA/Command/init.pm @@ -27,7 +27,7 @@ sub opt_spec { return (@global_opts, [], @local_opts); } -sub validate_args { ## no critic CognitiveComplexity::ProhibitExcessCognitiveComplexity +sub validate_args { ## no critic (CognitiveComplexity::ProhibitExcessCognitiveComplexity) my ($self, $opt, $args) = @_; # no args allowed but options! $self->usage_error("No args allowed") if @$args; diff --git a/lib/SLUB/LZA/TA/Command/report.pm b/lib/SLUB/LZA/TA/Command/report.pm index 84a37d6..fbc8d05 100644 --- a/lib/SLUB/LZA/TA/Command/report.pm +++ b/lib/SLUB/LZA/TA/Command/report.pm @@ -117,7 +117,7 @@ sub opt_spec { ); return (@global_opts, [], @local_opts); } -sub validate_args { ## no critic CognitiveComplexity::ProhibitExcessCognitiveComplexity +sub validate_args { ## no critic (CognitiveComplexity::ProhibitExcessCognitiveComplexity) my ($self, $opt, $args) = @_; SLUB::LZA::TA::common_global_validate($self, $opt, $args); # no args allowed but options! @@ -271,7 +271,7 @@ PAINLESS return $aips_response; } -sub get_ldp_projects { ## no critic CognitiveComplexity::ProhibitExcessCognitiveComplexity +sub get_ldp_projects { ## no critic (CognitiveComplexity::ProhibitExcessCognitiveComplexity) my ($self, $opt, $args) = @_; my $query = SLUB::LZA::TA::Archivematica::Elasticsearch::PrepareQuery::prepare_ldpprojects_query(@_); my $response = SLUB::LZA::TA::Archivematica::Elasticsearch::query_elasticsearch( @@ -509,7 +509,7 @@ sub execute { return 1; } -sub prepare_for_table($results, $ldp_projects) { ## no critic CognitiveComplexity::ProhibitExcessCognitiveComplexity +sub prepare_for_table($results, $ldp_projects) { ## no critic (CognitiveComplexity::ProhibitExcessCognitiveComplexity) my @table; foreach my $set (SETS) { foreach my $aip_state (AIPSTATE) { @@ -553,7 +553,7 @@ sub prepare_for_table($results, $ldp_projects) { ## no critic CognitiveComplexit return \@headers, \@table; } -sub print_humanreadable_report ($results) { ## no critic CognitiveComplexity::ProhibitExcessCognitiveComplexity +sub print_humanreadable_report ($results) { ## no critic (CognitiveComplexity::ProhibitExcessCognitiveComplexity) say <<"RPTHEADER"; :lang: en :doctype: article diff --git a/lib/SLUB/LZA/TA/Command/search.pm b/lib/SLUB/LZA/TA/Command/search.pm index a49697a..1bea181 100644 --- a/lib/SLUB/LZA/TA/Command/search.pm +++ b/lib/SLUB/LZA/TA/Command/search.pm @@ -118,8 +118,8 @@ sub opt_spec { ); return (@global_opts, [], @local_opts); } -sub validate_args { ## no critic CognitiveComplexity::ProhibitExcessCognitiveComplexity - my ($self, $opt, $args) = @_; + +sub validate_args($self, $opt, $args) { ## no critic qw(CognitiveComplexity::ProhibitExcessCognitiveComplexity Subroutines::ProhibitExcessComplexity) SLUB::LZA::TA::common_global_validate($self, $opt, $args); # no args allowed but options! $self->usage_error("No args allowed") if @$args; -- GitLab