mapaction/mapactionpy_controller

View on GitHub

Showing 10 of 23 total issues

File recipe_layer.py has 263 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import logging
import os
# import shapefile
import fiona
import glob
Severity: Minor
Found in mapactionpy_controller/recipe_layer.py - About 2 hrs to fix

    Function layer_reg_ex_adapter has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def layer_reg_ex_adapter(recipe_lyr, cmf):
        """
        Creates context data to support human readable intepritation of the regex used to
        seach for datasets.
        The key to this adapter is the fact that in most cases the layer's `reg_ex` property
    Severity: Minor
    Found in mapactionpy_controller/task_renderer.py - About 1 hr 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 parse_feedback has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    def parse_feedback(status, msg, step, **kwargs):
        """
        This is called once per step execution.
        It provides a hook into print messages to the terminal, log files and the JIRA Client.
        """
    Severity: Minor
    Found in mapactionpy_controller/main_stack.py - About 1 hr 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 _get_version_number has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def _get_version_number():
        travis_build = environ.get('TRAVIS_BUILD_NUMBER')
        travis_tag = environ.get('TRAVIS_TAG')
        repo_slug = environ.get('TRAVIS_REPO_SLUG')
        if repo_slug:
    Severity: Minor
    Found in setup.py - About 55 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 __init__ has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(self, cmf, extension, verify_on_creation=True):
            """
            Positional Arguments:
                * cmf: Either a CrashMoveFolder object or a path to a cmf_description.json file. If it
                       is a CrashMoveFolder object and cmf.verify_paths() returns False then an
    Severity: Minor
    Found in mapactionpy_controller/layer_properties.py - About 55 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 __init__ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(self, nc_json_path):
            self.nc_json_path = nc_json_path
            self._clause_validation = {}
    
            with open(self.nc_json_path) as json_file:
    Severity: Minor
    Found in mapactionpy_controller/name_convention.py - About 45 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 __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Confirmed

        def __init__(self, func, fail_threshold, running_msg, complete_msg, fail_msg):
    Severity: Minor
    Found in mapactionpy_controller/steps.py - About 35 mins to fix

      Function _get_requires_list has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      def _get_requires_list():
          # Items for which the version does not need to be pinned to support py2.7
          requires = [
              'chevron',
              'dicttoxml',
      Severity: Minor
      Found in setup.py - About 35 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 _init_known_values has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def _init_known_values(self, csv_path, csv_file, lookup_field):
              csv_reader = csv.DictReader(
                  csv_file, delimiter=',', quotechar='"')
      
              if lookup_field in csv_reader.fieldnames:
      Severity: Minor
      Found in mapactionpy_controller/name_clause_validators.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 search_issue_by_unique_summary has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def search_issue_by_unique_summary(self, search_summary, op_id):
              # Default if `op_id` is None
              jql_op_id = 'operational_id is EMPTY'
              if op_id:
                  jql_op_id = 'operational_id ~ "{}"'.format(op_id)
      Severity: Minor
      Found in mapactionpy_controller/jira_tasks.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