Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Address Perl::Criitc issues

  • Loading branch information...
commit 037e6a8eeb976844d2c381e269bcd34b5a7d48ab 1 parent 57db08a
Ray Miller authored
5 lib/LIMS2/Task.pm
@@ -62,7 +62,7 @@ has schema => (
62 62 sub _build_schema {
63 63 my $self = shift;
64 64
65   - LIMS2::Model::DBConnect->connect( 'LIMS2_DB', 'tasks' );
  65 + return LIMS2::Model::DBConnect->connect( 'LIMS2_DB', 'tasks' );
66 66 }
67 67
68 68 has model => (
@@ -75,7 +75,7 @@ has model => (
75 75 sub _build_model {
76 76 my $self = shift;
77 77 require LIMS2::Model;
78   - LIMS2::Model->new( schema => $self->schema );
  78 + return LIMS2::Model->new( schema => $self->schema );
79 79 }
80 80
81 81 has ensembl_util => (
@@ -101,6 +101,7 @@ sub BUILD {
101 101 : $WARN;
102 102
103 103 Log::Log4perl->easy_init( { level => $log_level, layout => $self->log_layout } );
  104 + return;
104 105 }
105 106
106 107 override command_names => sub {
10 lib/LIMS2/Task/YAMLDataLoader.pm
@@ -52,7 +52,7 @@ sub execute {
52 52 $self->log->info( "Running " . $self->abstract );
53 53
54 54 my ( $total_seen, $total_skipped, $total_err ) = (0,0,0);
55   -
  55 +
56 56 for my $input_file ( @{$args} ) {
57 57 my ( $file_seen, $file_skipped, $file_err ) = $self->load_data_from_file( $input_file );
58 58 $total_seen += $file_seen;
@@ -61,11 +61,13 @@ sub execute {
61 61 }
62 62
63 63 $self->log->info( "Processed $total_seen records (skipped $total_skipped, failed $total_err)" );
  64 +
  65 + return;
64 66 }
65 67
66 68 sub load_data_from_file {
67 69 my ( $self, $input_file ) = @_;
68   -
  70 +
69 71 $self->log->info( "Loading data from $input_file" );
70 72 my ($file_seen, $file_skipped, $file_err) = (0,0,0);
71 73 my $it = iyaml( $input_file );
@@ -73,11 +75,11 @@ sub load_data_from_file {
73 75 $file_seen++;
74 76 if ( ! $self->wanted( $datum ) ) {
75 77 $file_skipped++;
76   - next;
  78 + next;
77 79 }
78 80 try {
79 81 $self->model->txn_do(
80   - sub {
  82 + sub {
81 83 $self->create( $datum );
82 84 unless ( $self->commit ) {
83 85 $self->model->txn_rollback;
4 lib/LIMS2/Tasks.pm
@@ -8,7 +8,9 @@ use namespace::autoclean;
8 8
9 9 extends 'MooseX::App::Cmd';
10 10
11   -use constant plugin_search_path => [ 'LIMS2::Task::General', 'LIMS2::Task::YAMLDataLoader' ];
  11 +sub plugin_search_path {
  12 + return [ 'LIMS2::Task::General', 'LIMS2::Task::YAMLDataLoader' ];
  13 +}
12 14
13 15 __PACKAGE__->meta->make_immutable;
14 16

0 comments on commit 037e6a8

Please sign in to comment.
Something went wrong with that request. Please try again.