digidotcom/python-wpa-supplicant

View on GitHub

Showing 7 of 11 total issues

File core.py has 617 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (c) 2015 Digi International Inc. All Rights Reserved.
Severity: Major
Found in wpa_supplicant/core.py - About 1 day to fix

    Interface has 24 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Interface(BaseIface):
        """Interface implemented by objects related to network interface added to wpa_supplicant"""
    
        INTERFACE_PATH = 'fi.w1.wpa_supplicant1.Interface'
    
    
    Severity: Minor
    Found in wpa_supplicant/core.py - About 2 hrs to fix

      Function scan has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def scan(self, type='active', ssids=None, ies=None, channels=None, block=False):
      Severity: Minor
      Found in wpa_supplicant/core.py - About 35 mins to fix

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

            def __init__(self, signal_name, callback, remote_object, remote_interface, reactor):
        Severity: Minor
        Found in wpa_supplicant/core.py - About 35 mins to fix

          Function _catch_remote_errors has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          def _catch_remote_errors(fn):
              """Decorator for catching and wrapping txdbus.error.RemoteError exceptions"""
              @wraps(fn)
              def closure(*args, **kwargs):
                  try:
          Severity: Minor
          Found in wpa_supplicant/core.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 get_channel has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def get_channel(self):
                  """Wi-Fi channel number (1-14)"""
                  freq = self.get_frequency()
          
                  if freq == 2484:  # Handle channel 14
          Severity: Minor
          Found in wpa_supplicant/core.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 get_network_type has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def get_network_type(self):
                  """Return the network type as a string
          
                  Possible values are:
                          'WPA'
          Severity: Minor
          Found in wpa_supplicant/core.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