mapaction/mapactionpy_controller

View on GitHub

Showing 18 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

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    nr_dict = {
    'name_to_validate': name_result.name_to_validate,
    'is_parsable': name_result.is_parsable,
    'valid_clause_list': [
    {'valid_clause': clause_msg} for clause_msg in sorted(valid_clause_list)],
    Severity: Major
    Found in mapactionpy_controller/task_renderer.py and 1 other location - About 2 hrs to fix
    mapactionpy_controller/task_renderer.py on lines 202..208

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    nr_dict = {
    'name_to_validate': ncr.name_to_validate,
    'is_parsable': ncr.is_parsable,
    'valid_clause_list': [
    {'valid_clause': clause_msg} for clause_msg in sorted(valid_clause_list)],
    Severity: Major
    Found in mapactionpy_controller/task_renderer.py and 1 other location - About 2 hrs to fix
    mapactionpy_controller/task_renderer.py on lines 151..157

    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

    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

    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

    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

    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

    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

      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

      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

      TODO found
      Confirmed

      # TODO read these in from a config file
      Severity: Minor
      Found in mapactionpy_controller/jira_tasks.py by fixme

      TODO found
      Open

      # TODO re-enable "Have the input files changed?"
      Severity: Minor
      Found in mapactionpy_controller/plugin_base.py by fixme

      TODO found
      Open

      # TODO: asmith 2020/03/03
      Severity: Minor
      Found in mapactionpy_controller/plugin_base.py by fixme

      TODO found
      Open

      # TODO: This is hackish. It should really be evident from the DataClauseValues object

      TODO found
      Open

      # TODO Review is it is possible in the case of warnings, to pass back an updated
      Severity: Minor
      Found in mapactionpy_controller/steps.py by fixme

      TODO found
      Open

      # TODO: This results in calling `os.path.join` twice for certain files
      Severity: Minor
      Found in mapactionpy_controller/plugin_base.py by fixme
      Severity
      Category
      Status
      Source
      Language