Showing 5,781 of 10,536 total issues

Function generate_excel has a Cognitive Complexity of 163 (exceeds 5 allowed). Consider refactoring.
Open

def generate_excel(report,
                   name,
                   base_period_start_datetime_local,
                   base_period_end_datetime_local,
                   reporting_start_datetime_local,
Severity: Minor
Found in myems-api/excelexporters/combinedequipmentsaving.py - About 3 days 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 generate_excel has a Cognitive Complexity of 163 (exceeds 5 allowed). Consider refactoring.
Open

def generate_excel(report,
                   name,
                   base_period_start_datetime_local,
                   base_period_end_datetime_local,
                   reporting_start_datetime_local,
Severity: Minor
Found in myems-api/excelexporters/combinedequipmentplan.py - About 3 days 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 AgendaView has 660 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function AgendaView(element, calendar, viewName) {
        var t = this;


        // exports
Severity: Major
Found in myems-admin/js/plugins/fullcalendar/fullcalendar.min.js - About 3 days to fix

    Function IDC_Y has 652 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function IDC_Y(cp) {
      if (0x0030 <= cp && cp <= 0x0039) return true;
      if (0x0041 <= cp && cp <= 0x005A) return true;
      if (cp === 0x005F) return true;
      if (0x0061 <= cp && cp <= 0x007A) return true;
    Severity: Major
    Found in myems-admin/js/angular/angular-parse-ext.js - About 3 days to fix

      Function on_get has a Cognitive Complexity of 158 (exceeds 5 allowed). Consider refactoring.
      Open

          def on_get(req, resp):
              if 'API-KEY' not in req.headers or \
                      not isinstance(req.headers['API-KEY'], str) or \
                      len(str.strip(req.headers['API-KEY'])) == 0:
                  access_control(req)
      Severity: Minor
      Found in myems-api/reports/meterplan.py - About 3 days 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 on_get has a Cognitive Complexity of 158 (exceeds 5 allowed). Consider refactoring.
      Open

          def on_get(req, resp):
              if 'API-KEY' not in req.headers or \
                      not isinstance(req.headers['API-KEY'], str) or \
                      len(str.strip(req.headers['API-KEY'])) == 0:
                  access_control(req)
      Severity: Minor
      Found in myems-api/reports/metersaving.py - About 3 days 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 generate_excel has a Cognitive Complexity of 158 (exceeds 5 allowed). Consider refactoring.
      Open

      def generate_excel(report,
                         name,
                         base_period_start_datetime_local,
                         base_period_end_datetime_local,
                         reporting_start_datetime_local,
      Severity: Minor
      Found in myems-api/excelexporters/spaceoutput.py - About 3 days 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 on_post has a Cognitive Complexity of 158 (exceeds 5 allowed). Consider refactoring.
      Open

          def on_post(req, resp):
              """Handles POST requests"""
              admin_control(req)
              try:
                  raw_json = req.stream.read().decode('utf-8')
      Severity: Minor
      Found in myems-api/core/equipment.py - About 3 days 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

      File angular-parse-ext.js has 1231 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       * @license AngularJS v1.8.3
       * (c) 2010-2020 Google LLC. http://angularjs.org
       * License: MIT
       */
      Severity: Major
      Found in myems-admin/js/angular/angular-parse-ext.js - About 3 days to fix

        Function on_get has a Cognitive Complexity of 156 (exceeds 5 allowed). Consider refactoring.
        Open

            def on_get(req, resp):
                if 'API-KEY' not in req.headers or \
                        not isinstance(req.headers['API-KEY'], str) or \
                        len(str.strip(req.headers['API-KEY'])) == 0:
                    access_control(req)
        Severity: Minor
        Found in myems-api/reports/energystoragepowerstationreportingrevenue.py - About 3 days 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 on_get has a Cognitive Complexity of 156 (exceeds 5 allowed). Consider refactoring.
        Open

            def on_get(req, resp):
                if 'API-KEY' not in req.headers or \
                        not isinstance(req.headers['API-KEY'], str) or \
                        len(str.strip(req.headers['API-KEY'])) == 0:
                    access_control(req)
        Severity: Minor
        Found in myems-api/reports/energystoragepowerstationreportingenergy.py - About 3 days 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 generate_excel has a Cognitive Complexity of 156 (exceeds 5 allowed). Consider refactoring.
        Open

        def generate_excel(report,
                           name,
                           base_period_start_datetime_local,
                           base_period_end_datetime_local,
                           reporting_start_datetime_local,
        Severity: Minor
        Found in myems-api/excelexporters/shopfloorplan.py - About 3 days 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 generate_excel has a Cognitive Complexity of 156 (exceeds 5 allowed). Consider refactoring.
        Open

        def generate_excel(report,
                           name,
                           base_period_start_datetime_local,
                           base_period_end_datetime_local,
                           reporting_start_datetime_local,
        Severity: Minor
        Found in myems-api/excelexporters/storeplan.py - About 3 days 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 generate_excel has a Cognitive Complexity of 156 (exceeds 5 allowed). Consider refactoring.
        Open

        def generate_excel(report,
                           name,
                           base_period_start_datetime_local,
                           base_period_end_datetime_local,
                           reporting_start_datetime_local,
        Severity: Minor
        Found in myems-api/excelexporters/shopfloorsaving.py - About 3 days 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 generate_excel has a Cognitive Complexity of 156 (exceeds 5 allowed). Consider refactoring.
        Open

        def generate_excel(report,
                           name,
                           base_period_start_datetime_local,
                           base_period_end_datetime_local,
                           reporting_start_datetime_local,
        Severity: Minor
        Found in myems-api/excelexporters/tenantsaving.py - About 3 days 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 generate_excel has a Cognitive Complexity of 156 (exceeds 5 allowed). Consider refactoring.
        Open

        def generate_excel(report,
                           name,
                           base_period_start_datetime_local,
                           base_period_end_datetime_local,
                           reporting_start_datetime_local,
        Severity: Minor
        Found in myems-api/excelexporters/storesaving.py - About 3 days 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 generate_excel has a Cognitive Complexity of 156 (exceeds 5 allowed). Consider refactoring.
        Open

        def generate_excel(report,
                           name,
                           base_period_start_datetime_local,
                           base_period_end_datetime_local,
                           reporting_start_datetime_local,
        Severity: Minor
        Found in myems-api/excelexporters/tenantplan.py - About 3 days 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 generate_excel has a Cognitive Complexity of 154 (exceeds 5 allowed). Consider refactoring.
        Open

        def generate_excel(report,
                           name,
                           base_period_start_datetime_local,
                           base_period_end_datetime_local,
                           reporting_start_datetime_local,
        Severity: Minor
        Found in myems-api/excelexporters/equipmentplan.py - About 3 days 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 generate_excel has a Cognitive Complexity of 154 (exceeds 5 allowed). Consider refactoring.
        Open

        def generate_excel(report,
                           name,
                           base_period_start_datetime_local,
                           base_period_end_datetime_local,
                           reporting_start_datetime_local,
        Severity: Minor
        Found in myems-api/excelexporters/equipmentsaving.py - About 3 days 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

        File virtualmeter.py has 1211 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import uuid
        from datetime import datetime, timedelta
        import falcon
        import mysql.connector
        import simplejson as json
        Severity: Major
        Found in myems-api/core/virtualmeter.py - About 3 days to fix
          Severity
          Category
          Status
          Source
          Language