Showing 5,781 of 10,536 total issues

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

    def on_get(req, resp, id_):
        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/core/combinedequipment.py - About 2 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 spaceenergycategory.py has 953 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import base64
from core.utilities import get_translation
import os
import re
import uuid
Severity: Major
Found in myems-api/excelexporters/spaceenergycategory.py - About 2 days to fix

    Function $AnimateCssProvider has 470 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var $AnimateCssProvider = ['$animateProvider', /** @this */ function($animateProvider) {
    
      this.$get = ['$window', '$$jqLite', '$$AnimateRunner', '$timeout', '$$animateCache',
                   '$$forceReflow', '$sniffer', '$$rAFScheduler', '$$animateQueue',
           function($window,   $$jqLite,   $$AnimateRunner,   $timeout,   $$animateCache,
    Severity: Major
    Found in myems-admin/js/angular/angular-animate.js - About 2 days to fix

      Function init has 470 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function init(plot) {
      
              var canvas = null,
                  target = null,
                  options = null,
      Severity: Major
      Found in myems-admin/js/plugins/flot/jquery.flot.pie.js - About 2 days to fix

        Function ga has 466 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function ga(z, s) {
            function m() {
              u = j.length;
              p = v * 2 / u;
              for (var b = 0; b < u; b++) ha(b);
        Severity: Major
        Found in myems-admin/js/jquery/jquery.carousel.min.js - About 2 days to fix

          File Notification.js has 943 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React, { createRef, Fragment, useEffect, useState } from 'react';
          import paginationFactory, { PaginationProvider } from 'react-bootstrap-table2-paginator';
          import BootstrapTable from 'react-bootstrap-table-next';
          import { toast } from 'react-toastify';
          import {
          Severity: Major
          Found in myems-web/src/components/MyEMS/Notification/Notification.js - About 2 days to fix

            Function $get has 465 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                   function($window,   $$jqLite,   $$AnimateRunner,   $timeout,   $$animateCache,
                            $$forceReflow,   $sniffer,   $$rAFScheduler, $$animateQueue) {
            
                var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);
            
            
            Severity: Major
            Found in myems-admin/js/angular/angular-animate.js - About 2 days to fix

              Function DayEventRenderer has 463 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function DayEventRenderer() {
                      var t = this;
              
              
                      // exports
              Severity: Major
              Found in myems-admin/js/plugins/fullcalendar/fullcalendar.min.js - About 2 days to fix

                File combinedequipmentefficiency.py has 934 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import base64
                from core.utilities import get_translation
                import os
                import re
                import uuid
                Severity: Major
                Found in myems-api/excelexporters/combinedequipmentefficiency.py - About 2 days to fix

                  Function on_get has a Cognitive Complexity of 113 (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/tenantbill.py - About 2 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 Calendar has 449 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function Calendar(element, instanceOptions) {
                      var t = this;
                  
                  
                  
                  
                  Severity: Major
                  Found in myems-admin/js/plugins/fullcalendar/fullcalendar.js - About 2 days to fix

                    Function on_get has a Cognitive Complexity of 108 (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/virtualmeterplan.py - About 2 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 108 (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/offlinemetersaving.py - About 2 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 108 (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/virtualmetersaving.py - About 2 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 108 (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/offlinemeterplan.py - About 2 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 combinedequipmentenergycategory.py has 888 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import base64
                    from core.utilities import get_translation
                    import os
                    import re
                    import uuid
                    Severity: Major
                    Found in myems-api/excelexporters/combinedequipmentenergycategory.py - About 2 days to fix

                      Function initClass has 425 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          value: function initClass() {
                            // Exposing the emitter class, mainly for tests
                            this.prototype.Emitter = Emitter;
                            /*
                             This is a list of all available events you can register on a dropzone object.
                      Severity: Major
                      Found in myems-admin/js/plugins/dropzone/dropzone.js - About 2 days to fix

                        File storeenergycategory.py has 874 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import base64
                        from core.utilities import get_translation
                        import os
                        import re
                        import uuid
                        Severity: Major
                        Found in myems-api/excelexporters/storeenergycategory.py - About 2 days to fix

                          File equipmentefficiency.py has 873 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import base64
                          from core.utilities import get_translation
                          import os
                          import re
                          import uuid
                          Severity: Major
                          Found in myems-api/excelexporters/equipmentefficiency.py - About 2 days to fix

                            File shopfloorenergycategory.py has 872 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import base64
                            from core.utilities import get_translation
                            import os
                            import re
                            import uuid
                            Severity: Major
                            Found in myems-api/excelexporters/shopfloorenergycategory.py - About 2 days to fix
                              Severity
                              Category
                              Status
                              Source
                              Language