maestro-server/report-app

View on GitHub

Showing 10 of 307 total issues

LinksysInterpreter has 73 functions (exceeds 20 allowed). Consider refactoring.
Open

    class LinksysInterpreter(cmd.Cmd):
        """Interpret commands to perform LinkSys programming actions."""
        def __init__(self):
            cmd.Cmd.__init__(self)
            self.session = LinksysSession()
Severity: Major
Found in share/doc/pycurl/examples/linksys.py - About 1 day to fix

    File linksys.py has 443 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    #! /usr/bin/env python
    # -*- coding: utf-8 -*-
    # vi:ts=4:et
    #
    # linksys.py -- program settings on a Linkys router
    Severity: Minor
    Found in share/doc/pycurl/examples/linksys.py - About 6 hrs to fix

      LinksysSession has 37 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class LinksysSession:
          months = 'Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec'
      
          WAN_CONNECT_AUTO = '1'
          WAN_CONNECT_STATIC = '2'
      Severity: Minor
      Found in share/doc/pycurl/examples/linksys.py - About 4 hrs to fix

        Function factory has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            def factory(self, input, owner_id):
                mapp = self.__mapper()
        
                prev = ''
                prepared = []
        Severity: Minor
        Found in app/services/pivotPipeline.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 getAll has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def getAll(self, filter={}, limit=10, skip=0, orderBy='updated_at', direction=-1):
        Severity: Minor
        Found in app/repository/reports.py - About 35 mins to fix

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

              def __init__(self, field, lens=None, sublens='_id', include=[], opts={}):
          Severity: Minor
          Found in app/services/aggregator/aggr.py - About 35 mins to fix

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

            def task_upload(report_id, owner_user, name, result, type=None):
            Severity: Minor
            Found in app/tasks/upload_json.py - About 35 mins to fix

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

                  def configure(self):
                      "Write configuration changes to the Linksys."
                      if self.actions:
                          fields = []
                          self.cache_flush()
              Severity: Minor
              Found in share/doc/pycurl/examples/linksys.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 json.JSONEncoder.default(self, obj)
              Severity: Major
              Found in app/libs/jsonEncoder.py - About 30 mins to fix

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

                    def post(self):
                        """
                        @api {post} /reports Insert Batch Process
                        @apiName PostReport
                        @apiGroup Reports
                Severity: Minor
                Found in app/controller/reports.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