gurdulu/virga

View on GitHub

Showing 6 of 6 total issues

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

    def convert_dicts_to_test_format(origin: str, data: list) -> list:
        """
        Convert a list of dictionaries in a format ready for tests.

        :param origin: The parent key of the dictionary
Severity: Minor
Found in virga/providers/aws/provider.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 convert_struct has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def convert_struct(self, resource: dict) -> list:
        """
        Convert a dictionary in a list of assertions.

        :param resource: Resource to analyse
Severity: Minor
Found in virga/providers/aws/provider.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 convert_list_to_test_format has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def convert_list_to_test_format(origin: str, data: list) -> str:
        """
        Convert a list in a format ready for tests.

        :param origin: The parent key of the list
Severity: Minor
Found in virga/providers/aws/provider.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 convert_dict_to_test_format has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def convert_dict_to_test_format(origin: str, data: dict) -> str:
        """
        Convert a dictionary in a format ready for tests.

        :param origin: The parent key of the dictionary
Severity: Minor
Found in virga/providers/aws/provider.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 output has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def output(self, resource: dict, resource_id: str):
        """
        Save the resource in a JSON file.

        If the arg -output is set, dump on file the result of the query in JSON format.
Severity: Minor
Found in virga/providers/abstract.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

Avoid too many return statements within this function.
Open

        return True
Severity: Major
Found in virga/providers/abstract.py - About 30 mins to fix
    Severity
    Category
    Status
    Source
    Language