koenvervloesem/snipskit

View on GitHub

Showing 5 of 29 total issues

File config.py has 281 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""This module gives a way to access the configuration of a locally installed
instance of Snips, a Snips assistant and a Snips skill.

Classes:

Severity: Minor
Found in src/snipskit/config.py - About 2 hrs to fix

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

        def __init__(self, hostname=None, ca_file=None, ca_path=None,
    Severity: Minor
    Found in src/snipskit/config.py - About 45 mins to fix

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

          def _register_callbacks(self):
              """Subscribe to the Hermes events we're interested in.
      
              Each method with an attribute set by a decorator is registered as a
              callback for the corresponding event.
      Severity: Minor
      Found in src/snipskit/hermes/components.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 __init__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def __init__(self, filename=None):
              """Initialize a :class:`.SnipsConfig` object.
      
              The :attr:`mqtt` attribute is initialized with the MQTT connection
              settings from the configuration file, or the default value
      Severity: Minor
      Found in src/snipskit/config.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 version has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      def version(service=None):
          """Return the version number of a Snips service or the Snips platform.
      
          If the `service` argument is empty, this returns the minimum value of the
          version numbers of all installed Snips services.
      Severity: Minor
      Found in src/snipskit/services.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