src/tests/catwalk_tests/test_model_trainers.py

Summary

Maintainability
A
2 hrs
Test Coverage

Function test_model_trainer has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def test_model_trainer(grid_config, default_model_trainer):
    trainer = default_model_trainer
    db_engine = trainer.db_engine
    project_storage = trainer.model_storage_engine.project_storage
    model_storage_engine = trainer.model_storage_engine
Severity: Minor
Found in src/tests/catwalk_tests/test_model_trainers.py - About 1 hr to fix

    Function test_reuse_model_random_seeds has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def test_reuse_model_random_seeds(grid_config, default_model_trainer):
        trainer = default_model_trainer
        db_engine = trainer.db_engine
        project_storage = trainer.model_storage_engine.project_storage
        model_storage_engine = trainer.model_storage_engine
    Severity: Minor
    Found in src/tests/catwalk_tests/test_model_trainers.py - About 1 hr to fix

      Trailing whitespace
      Open

              config={'foo': 'bar'}, 

      Trailing whitespace is superfluous.

      The warning returned varies on whether the line itself is blank,
      for easier filtering for those who want to indent their blank lines.
      
      Okay: spam(1)\n#
      W291: spam(1) \n#
      W293: class Foo(object):\n    \n    bang = 12

      Trailing whitespace
      Open

              config={'baz': 'qux'}, 

      Trailing whitespace is superfluous.

      The warning returned varies on whether the line itself is blank,
      for easier filtering for those who want to indent their blank lines.
      
      Okay: spam(1)\n#
      W291: spam(1) \n#
      W293: class Foo(object):\n    \n    bang = 12

      At least two spaces before inline comment
      Open

          random.seed(42) # different from above

      Separate inline comments by at least two spaces.

      An inline comment is a comment on the same line as a statement.
      Inline comments should be separated by at least two spaces from the
      statement. They should start with a # and a single space.
      
      Each line of a block comment starts with a # and a single space
      (unless it is indented text inside the comment).
      
      Okay: x = x + 1  # Increment x
      Okay: x = x + 1    # Increment x
      Okay: # Block comment
      E261: x = x + 1 # Increment x
      E262: x = x + 1  #Increment x
      E262: x = x + 1  #  Increment x
      E265: #Block comment
      E266: ### Block comment

      Trailing whitespace
      Open

              config={'foo': 'bar'}, 

      Trailing whitespace is superfluous.

      The warning returned varies on whether the line itself is blank,
      for easier filtering for those who want to indent their blank lines.
      
      Okay: spam(1)\n#
      W291: spam(1) \n#
      W293: class Foo(object):\n    \n    bang = 12

      Missing whitespace after ','
      Open

          new_grid['sklearn.tree.DecisionTreeClassifier']['min_samples_split'] = [3,10,100]

      Each comma, semicolon or colon should be followed by whitespace.

      Okay: [a, b]
      Okay: (3,)
      Okay: a[1:4]
      Okay: a[:4]
      Okay: a[1:]
      Okay: a[1:4:2]
      E231: ['a','b']
      E231: foo(bar,baz)
      E231: [{'a':'b'}]

      Line too long (91 > 88 characters)
      Open

          # to exist, which we're not getting in these tests since we aren't using the experiment

      Limit all lines to a maximum of 79 characters.

      There are still many devices around that are limited to 80 character
      lines; plus, limiting windows to 80 characters makes it possible to
      have several windows side-by-side.  The default wrapping on such
      devices looks ugly.  Therefore, please limit all lines to a maximum
      of 79 characters. For flowing long blocks of text (docstrings or
      comments), limiting the length to 72 characters is recommended.
      
      Reports error E501.

      Trailing whitespace
      Open

                  LEFT JOIN triage_metadata.experiment_models em 

      Trailing whitespace is superfluous.

      The warning returned varies on whether the line itself is blank,
      for easier filtering for those who want to indent their blank lines.
      
      Okay: spam(1)\n#
      W291: spam(1) \n#
      W293: class Foo(object):\n    \n    bang = 12

      Trailing whitespace
      Open

              config={'lorem': 'ipsum'}, 

      Trailing whitespace is superfluous.

      The warning returned varies on whether the line itself is blank,
      for easier filtering for those who want to indent their blank lines.
      
      Okay: spam(1)\n#
      W291: spam(1) \n#
      W293: class Foo(object):\n    \n    bang = 12

      Trailing whitespace
      Open

              config={'foo': 'bar'}, 

      Trailing whitespace is superfluous.

      The warning returned varies on whether the line itself is blank,
      for easier filtering for those who want to indent their blank lines.
      
      Okay: spam(1)\n#
      W291: spam(1) \n#
      W293: class Foo(object):\n    \n    bang = 12

      Trailing whitespace
      Open

                  INSERT INTO triage_metadata.experiment_models(experiment_hash,model_hash) 

      Trailing whitespace is superfluous.

      The warning returned varies on whether the line itself is blank,
      for easier filtering for those who want to indent their blank lines.
      
      Okay: spam(1)\n#
      W291: spam(1) \n#
      W293: class Foo(object):\n    \n    bang = 12

      Missing whitespace after ','
      Open

          new_grid['sklearn.tree.DecisionTreeClassifier']['min_samples_split'] = [3,10,100]

      Each comma, semicolon or colon should be followed by whitespace.

      Okay: [a, b]
      Okay: (3,)
      Okay: a[1:4]
      Okay: a[:4]
      Okay: a[1:]
      Okay: a[1:4:2]
      E231: ['a','b']
      E231: foo(bar,baz)
      E231: [{'a':'b'}]

      There are no issues that match your filters.

      Category
      Status