lliendo/Radar

View on GitHub

Showing 13 of 58 total issues

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

class Server(object):

    __metaclass__ = ABCMeta

    # TODO: Make IOCPMonitor work.
Severity: Minor
Found in radar/network/server.py - About 2 hrs to fix

    Client has 22 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Client(object):
    
        __metaclass__ = ABCMeta
    
        def __init__(self, address, port, socket=None, network_monitor_timeout=None, blocking_socket=True):
    Severity: Minor
    Found in radar/network/client.py - About 2 hrs to fix

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

          def __init__(self, id=None, name='', path='', args='', details='', data=None, enabled=True, platform_setup=None):
      Severity: Major
      Found in radar/check/__init__.py - About 1 hr to fix

        Function _serve_ready_clients has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def _serve_ready_clients(self, clients):
                for c in clients:
                    try:
                        self.on_receive(c)
                    except ClientReceiveError as error:
        Severity: Minor
        Found in radar/network/server.py - About 55 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 _lower_config_keys has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def _lower_config_keys(self, config):
                if type(config) == list:
                    return [self._lower_config_keys(d) for d in config]
        
                for k in list(config):
        Severity: Minor
        Found in radar/config/__init__.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 connect has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def connect(self):
                while not self.is_stopped() and not self.is_connected():
                    try:
                        super(RadarClient, self).connect()
                    except Exception as e:
        Severity: Minor
        Found in radar/client/__init__.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 _run_plugin has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def _run_plugin(self, plugin, address, port, message_type, checks, contacts):
        Severity: Minor
        Found in radar/plugin/__init__.py - About 45 mins to fix

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

              def _generate_dict_paths(self, d, path=None):
                  if not path:
                      path = []
          
                  if isinstance(d, dict):
          Severity: Minor
          Found in radar/initial_setup/__init__.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 __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def __init__(self, id=None, name='', email='', phone='', enabled=True):
          Severity: Minor
          Found in radar/contact/__init__.py - About 35 mins to fix

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

                def __init__(self, address, port, socket=None, network_monitor_timeout=None, blocking_socket=True):
            Severity: Minor
            Found in radar/network/client.py - About 35 mins to fix

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

                  def __init__(self, name='', addresses=None, checks=None, contacts=None, enabled=True):
              Severity: Minor
              Found in radar/monitor/__init__.py - About 35 mins to fix

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

                    def __init__(self, address, port, network_monitor=None, network_monitor_timeout=None, blocking_socket=True):
                Severity: Minor
                Found in radar/network/server.py - About 35 mins to fix

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

                      def run(self, address, port, message_type, checks, contacts):
                  Severity: Minor
                  Found in radar/plugin/__init__.py - About 35 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language