benjixx/goodplay

View on GitHub

Showing 12 of 74 total issues

File test_collection.py has 423 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-

pytest_plugins = 'pytester'


Severity: Minor
Found in tests/test_collection.py - About 6 hrs to fix

    File test_ansible_role_support_integration.py has 385 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    
    import tarfile
    
    import pytest
    Severity: Minor
    Found in tests/test_ansible_role_support_integration.py - About 5 hrs to fix

      File test_docker_support_integration.py has 309 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      
      import docker
      import docker.errors
      import docker.utils
      Severity: Minor
      Found in tests/test_docker_support_integration.py - About 3 hrs to fix

        CallbackModule has 22 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class CallbackModule(CallbackBase):
            CALLBACK_VERSION = 2.0
            CALLBACK_TYPE = 'notification'
            CALLBACK_NAME = 'goodplay'
        
        
        Severity: Minor
        Found in goodplay/ansible_support/callback_plugin/goodplay.py - About 2 hrs to fix

          Function create_role has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def create_role(
          Severity: Minor
          Found in tests/test_ansible_role_support_integration.py - About 35 mins to fix

            Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(self, ctx, fspath, parent=None, config=None, session=None):
            Severity: Minor
            Found in goodplay/plugin.py - About 35 mins to fix

              Function __iter__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __iter__(self):
                      # override default Capture to read lines as long as streams are open,
                      # thus iteration is not being stopped by large pauses between lines
                      # being available
                      while self.streams_open():
              Severity: Minor
              Found in goodplay/utils/subprocess.py - About 25 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function pull_required_images has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def pull_required_images(self):
                      required_images = set()
              
                      for host in self.ctx.inventory.hosts():
                          required_image = self.get_docker_image_for_host(host)
              Severity: Minor
              Found in goodplay/docker_support/__init__.py - About 25 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function final_test_task_outcome has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def final_test_task_outcome(self):
                      if self.per_host_outcomes:
                          outcomes = set(x['outcome'] for x in self.per_host_outcomes.values())
                          outcome_priority = ('failed', 'skipped', 'passed')
                          for outcome in outcome_priority:
              Severity: Minor
              Found in goodplay/ansible_support/callback_plugin/goodplay.py - About 25 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function wait_for_event has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def wait_for_event(self, event_name=None, **kwargs):
                      for event in self.receive_events():
                          if event['event_name'] == event_name \
                                  and set(kwargs.items()).issubset(set(event['data'].items())):
                              return event
              Severity: Minor
              Found in goodplay/ansible_support/runner.py - About 25 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function platform_manager has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def platform_manager(self):
                      platform_manager = PlatformManager.from_dicts(self.config['platforms'])
              
                      if self.is_platform_matrix_requested:
                          platforms = self.role_meta_info['galaxy_info'].get('platforms', [])
              Severity: Minor
              Found in goodplay/context.py - About 25 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function role_path has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def role_path(self):
                      for ancestor_path in self.playbook_path.parts(reverse=True)[1:]:
                          if ancestor_path.basename == 'tests':
                              role_path = ancestor_path.dirpath()
                              is_role_path = role_path.join('meta', 'main.yml').check(file=True)
              Severity: Minor
              Found in goodplay/context.py - About 25 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Severity
              Category
              Status
              Source
              Language