File recipe_layer.py
has 263 lines of code (exceeds 250 allowed). Consider refactoring.
import logging
import os
import fiona
import glob
Similar blocks of code found in 2 locations. Consider refactoring.
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)],
Similar blocks of code found in 2 locations. Consider refactoring.
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)],
Function layer_reg_ex_adapter
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
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
Function parse_feedback
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
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.
"""
Function _get_version_number
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
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:
Function __init__
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
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
Function __init__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
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:
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring.
def __init__(self, func, fail_threshold, running_msg, complete_msg, fail_msg):
Function _get_requires_list
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def _get_requires_list():
requires = [
'chevron',
'dicttoxml',
Function _init_known_values
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
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:
Function search_issue_by_unique_summary
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
def search_issue_by_unique_summary(self, search_summary, op_id):
jql_op_id = 'operational_id is EMPTY'
if op_id:
jql_op_id = 'operational_id ~ "{}"'.format(op_id)