Showing 5,781 of 10,536 total issues

Function link has 187 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            link: function($scope, element, attrs, modelCtrl) {
                var clear, customOpts, el, locale, opts, _formatted, _init, _picker, _setEndDate, _setStartDate, _validateMax, _validateMin;
                el = $(element);
                customOpts = $scope.opts;
                opts = angular.extend({}, dateRangePickerConfig, customOpts);
Severity: Major
Found in myems-admin/js/plugins/daterangepicker/angular-daterangepicker.js - About 7 hrs to fix

    Function drawSeriesLines has 187 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function drawSeriesLines(series) {
                function plotLine(datapoints, xoffset, yoffset, axisx, axisy) {
                    var points = datapoints.points,
                        ps = datapoints.pointsize,
                        prevx = null, prevy = null;
    Severity: Major
    Found in myems-admin/js/plugins/flot/jquery.flot.js - About 7 hrs to fix

      File energystoragepowerstationreportingenergy.py has 478 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import re
      from datetime import datetime, timedelta, timezone
      from decimal import Decimal
      import falcon
      import mysql.connector
      Severity: Minor
      Found in myems-api/reports/energystoragepowerstationreportingenergy.py - About 7 hrs to fix

        Function drawGrid has 186 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function drawGrid() {
                    var i, axes, bw, bc;
        
                    ctx.save();
                    ctx.translate(plotOffset.left, plotOffset.top);
        Severity: Major
        Found in myems-admin/js/plugins/flot/jquery.flot.js - About 7 hrs to fix

          File combined_equipment_energy_input_item.py has 472 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import random
          import time
          from datetime import datetime, timedelta
          from decimal import Decimal
          from multiprocessing import Pool
          Severity: Minor
          Found in myems-aggregation/combined_equipment_energy_input_item.py - About 7 hrs to fix

            File bootstrap-colorpicker-module.js has 470 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            'use strict';
            
            angular.module('colorpicker.module', [])
                .factory('Helper', function () {
                    return {
            Severity: Minor
            Found in myems-admin/js/plugins/colorpicker/bootstrap-colorpicker-module.js - About 7 hrs to fix

              File equipmentincome.py has 470 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import re
              from datetime import datetime, timedelta, timezone
              from decimal import Decimal
              import falcon
              import mysql.connector
              Severity: Minor
              Found in myems-api/reports/equipmentincome.py - About 7 hrs to fix

                File combined_equipment_energy_output_category.py has 469 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import random
                import time
                from datetime import datetime, timedelta
                from decimal import Decimal
                from multiprocessing import Pool
                Severity: Minor
                Found in myems-aggregation/combined_equipment_energy_output_category.py - About 7 hrs to fix

                  File shopfloor_energy_input_item.py has 469 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import random
                  import time
                  from datetime import datetime, timedelta
                  from decimal import Decimal
                  from multiprocessing import Pool
                  Severity: Minor
                  Found in myems-aggregation/shopfloor_energy_input_item.py - About 7 hrs to fix

                    File combined_equipment_energy_input_category.py has 469 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import random
                    import time
                    from datetime import datetime, timedelta
                    from decimal import Decimal
                    from multiprocessing import Pool
                    Severity: Minor
                    Found in myems-aggregation/combined_equipment_energy_input_category.py - About 7 hrs to fix

                      Function on_get has a Cognitive Complexity of 47 (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/distributionsystem.py - About 7 hrs 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_put has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def on_put(req, resp, id_, bid):
                              """Handles PUT requests"""
                              admin_control(req)
                              try:
                                  raw_json = req.stream.read().decode('utf-8')
                      Severity: Minor
                      Found in myems-api/core/energystoragecontainer.py - About 7 hrs 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 47 (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/virtualmeter.py - About 7 hrs 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 47 (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/virtualmeter.py - About 7 hrs 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 resourceFactory has 181 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                            function resourceFactory(url, paramDefaults, actions, options) {
                              var route = new Route(url, options);
                      
                              actions = extend({}, provider.defaults.actions, actions);
                      
                      
                      Severity: Major
                      Found in myems-admin/js/angular/angular-resource.js - About 7 hrs to fix

                        Function Calendar has 181 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const Calendar = () => {
                          const calendarRef = useRef();
                          const [calendarApi, setCalendarApi] = useState({});
                          const [title, setTitle] = useState('');
                          const [currentFilter, setCurrentFilter] = useState('Month View');
                        Severity: Major
                        Found in myems-web/src/components/calendar/Calendar.js - About 7 hrs to fix

                          File directives.js has 468 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          /**
                           * INSPINIA - Responsive Admin Theme
                           *
                           * Main directives.js file
                           * Define directives for used plugin
                          Severity: Minor
                          Found in myems-admin/app/directives/directives.js - About 7 hrs to fix

                            Function justifiedGallery has 180 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                               $.fn.justifiedGallery = function(options){
                            
                                       //TODO fare impostazione 'rel' che sostituisce tutti i link con il rel specificato
                            
                                    var settings = $.extend( {
                            Severity: Major
                            Found in myems-admin/js/plugins/justified-gallery/jquery.justifiedgallery.js - About 7 hrs to fix

                              File shopfloor_energy_input_category.py has 466 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import random
                              import time
                              from datetime import datetime, timedelta
                              from decimal import Decimal
                              from multiprocessing import Pool
                              Severity: Minor
                              Found in myems-aggregation/shopfloor_energy_input_category.py - About 7 hrs to fix

                                Function link has 179 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                      link: function (scope, element, attrs) {
                                        // We keep some chart-specific variables here as a closure
                                        // instead of storing them on 'scope'.
                                
                                        // prevSeriesOptions is maintained by processSeries
                                Severity: Major
                                Found in myems-admin/js/angular-highcharts/highcharts-ng.js - About 7 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language