avocado-framework/avocado

View on GitHub
avocado/core/settings.py

Summary

Maintainability
D
2 days
Test Coverage
A
90%

File settings.py has 648 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; specifically version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
Severity: Major
Found in avocado/core/settings.py - About 1 day to fix

    Function __init__ has 16 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(
    Severity: Major
    Found in avocado/core/settings.py - About 2 hrs to fix

      Function register_option has 16 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def register_option(
      Severity: Major
      Found in avocado/core/settings.py - About 2 hrs to fix

        Function add_argparser_to_option has 14 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def add_argparser_to_option(
        Severity: Major
        Found in avocado/core/settings.py - About 1 hr to fix

          Function add_argparser has 12 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def add_argparser(
          Severity: Major
          Found in avocado/core/settings.py - About 1 hr to fix

            Function merge_with_arguments has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                def merge_with_arguments(self, arg_parse_config):
                    """Merge the current settings with the command-line args.
            
                    After parsing argument options this method should be executed to have
                    an unified settings.
            Severity: Minor
            Found in avocado/core/settings.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 arg_parse_args has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                def arg_parse_args(self):
                    args = {"help": self.argparse_help_msg, "default": None}
            
                    if self.nargs:
                        args["nargs"] = self.nargs
            Severity: Minor
            Found in avocado/core/settings.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 set_value has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                def set_value(self, value, convert=False):
                    dst_type = self.key_type
            
                    if convert is False:
                        self._value = value
            Severity: Minor
            Found in avocado/core/settings.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

            There are no issues that match your filters.

            Category
            Status