samdmarshall/pyconfig

View on GitHub

Showing 33 of 76 total issues

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

    def value(self):
        value = self.__value
        if len(value) == 0:
            value = ''
        else:
Severity: Minor
Found in pyconfig/Deserializer/KeyValue.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 __runInitializer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def __runInitializer(self, configuration):
        """
        This method is to pass through the passed in file
        """
        self.__namespace_table[configuration.name] = dict()
Severity: Minor
Found in pyconfig/Analyzer/Engine.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 consume has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def consume(self, parsed_item=None):
        parsed_item = list() if parsed_item is None else parsed_item
        super(SettingKeyword, self).consume(parsed_item)

        if parsed_item[0] != Constants._setting:  # pylint: disable=protected-access
Severity: Minor
Found in pyconfig/Keyword/SettingKeyword.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 readQuotedString has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def readQuotedString(self):
        status = True
        while status is True:
            status = self.readString('"')
            if status is False:
Severity: Minor
Found in pyconfig/Analyzer/Linter.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 __gatherUserDefinedVariables has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def __gatherUserDefinedVariables(self):
        self.__user_defined_table = set()
        snapshot_of_dict = list(self.__namespace_table.items())
        for _configuration, values in snapshot_of_dict:
            for keyword in values.values():
Severity: Minor
Found in pyconfig/Analyzer/Engine.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 shouldAppendConditionItem has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def shouldAppendConditionItem(condition):
    result = False
    for case in Switch(condition):
        if case(''):
            break
Severity: Minor
Found in pyconfig/Deserializer/KeyValue.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 gatherAllVariables has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def gatherAllVariables(dictionary):
    settings_set = set()
    snapshot_of_dict = list(dictionary.items())
    for _configuration, values in snapshot_of_dict:
        for keyword in values.values():
Severity: Minor
Found in pyconfig/Analyzer/Engine.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 serialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def serialize(self):
        serialize_string = ''
        if self.uses_for:
            for key, value in self.configuration_values.items():
                serialize_string += self.serializeForStatement(key, value)
Severity: Minor
Found in pyconfig/Keyword/SettingKeyword.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 openOutputFileToWrite has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def openOutputFileToWrite(input_string):
    """
    Takes a path to the output file as a string and returns an open
    writeable file. The path will be expanded and parent directories
    will be created if necessary.
Severity: Minor
Found in pyconfig/Serializer/Serializer.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 findKeyValueAssignmentOffset has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def findKeyValueAssignmentOffset(cls, line, offset):
        result_offset = -1
        find_open_bracket = line.find('[')
        find_equals = line.find('=')
        new_offset = offset
Severity: Minor
Found in pyconfig/Deserializer/KeyValue.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 findPreviousDefinition has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def findPreviousDefinition(kv_array, configuration, setting_key):
    previous_definition_indexes = list()
    for file_name, value in kv_array:
        if file_name != configuration:
            setting_values = list(value.keys())
Severity: Minor
Found in pyconfig/Analyzer/Engine.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 findDuplicates has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def findDuplicates(dictionary):
    results = dict()
    settings_set = set()
    snapshot_of_dict = list(dictionary.items())
    for configuration, values in snapshot_of_dict:
Severity: Minor
Found in pyconfig/Analyzer/Engine.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 WalkNodes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def WalkNodes(visited=None, nodes_with_children=None):
    visited = set() if visited is None else visited
    nodes_with_children = list() if nodes_with_children is None else nodes_with_children

    child_nodes = list()
Severity: Minor
Found in pyconfig/Graph/Grapher.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