Showing 5,781 of 10,536 total issues

File meter.controller.js has 430 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

app.controller('MeterController', function($scope,
    $rootScope,
    $window,
Severity: Minor
Found in myems-admin/app/controllers/settings/meter/meter.controller.js - About 6 hrs to fix

    Function editEnergyStorageContainerBattery has 158 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          $scope.editEnergyStorageContainerBattery = function(energystoragecontainerbattery) {
              var modalInstance = $uibModal.open({
                  templateUrl: 'views/settings/energystoragecontainer/energystoragecontainerbattery.model.html',
                  controller: 'ModalEditEnergyStorageContainerBatteryCtrl',
                windowClass: "animated fadeIn",

      File metercarbon.py has 429 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/metercarbon.py - About 6 hrs to fix

        File metercost.py has 429 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/metercost.py - About 6 hrs to fix

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

                      link: function (scope, element, attrs, ngModel) {
                          var format = attrs.format || dateTimeConfig.format,
                              parentForm = element.inheritedData('$formController'),
                              views = $parse(attrs.views)(scope) || dateTimeConfig.views.concat(),
                              view = attrs.view || views[0],
          Severity: Major
          Found in myems-admin/js/plugins/datapicker/angular-datepicker.js - About 6 hrs to fix

            Function addEnergyStorageContainerBattery has 157 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  $scope.addEnergyStorageContainerBattery = function() {
            
                      var modalInstance = $uibModal.open({
                          templateUrl: 'views/settings/energystoragecontainer/energystoragecontainerbattery.model.html',
                          controller: 'ModalAddEnergyStorageContainerBatteryCtrl',

              Function ExifRestore has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
              Open

              function () {
                function ExifRestore() {
                  _classCallCheck(this, ExifRestore);
                }
              
              
              Severity: Minor
              Found in myems-admin/js/plugins/dropzone/dropzone.js - About 6 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 lists has 156 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          lists: (function( ) {
                              // Use a closure to hide a few variables.
                              var any_list = "[*+-]|\\d+\\.",
                                  bullet_list = /[*+-]/,
                                  number_list = /\d+\./,
              Severity: Major
              Found in myems-admin/js/plugins/bootstrap-markdown/markdown.js - About 6 hrs to fix

                Function ExifRestore has 156 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function () {
                  function ExifRestore() {
                    _classCallCheck(this, ExifRestore);
                  }
                
                
                Severity: Major
                Found in myems-admin/js/plugins/dropzone/dropzone.js - About 6 hrs to fix

                  File virtualmeterplan.py has 425 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/virtualmeterplan.py - About 6 hrs to fix

                    File offlinemetersaving.py has 425 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/offlinemetersaving.py - About 6 hrs to fix

                      File virtualmetersaving.py has 425 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/virtualmetersaving.py - About 6 hrs to fix

                        File offlinemeterplan.py has 425 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/offlinemeterplan.py - About 6 hrs to fix

                          File EnterProduction.js has 424 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import React, { Fragment, useEffect, useState } from 'react';
                          import {
                            Breadcrumb,
                            BreadcrumbItem,
                            Button,
                          Severity: Minor
                          Found in myems-web/src/components/MyEMS/Space/EnterProduction.js - About 6 hrs to fix

                            File gateway.py has 424 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import uuid
                            from datetime import datetime, timezone, timedelta
                            import falcon
                            import mysql.connector
                            import simplejson as json
                            Severity: Minor
                            Found in myems-api/core/gateway.py - About 6 hrs to fix

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

                              def generate_excel(report,
                                                 name,
                                                 reporting_start_datetime_local,
                                                 reporting_end_datetime_local,
                                                 period_type,
                              Severity: Minor
                              Found in myems-api/excelexporters/energystoragepowerstationreportingenergy.py - About 6 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 generate_excel has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def generate_excel(report,
                                                 name,
                                                 reporting_start_datetime_local,
                                                 reporting_end_datetime_local,
                                                 period_type,
                              Severity: Minor
                              Found in myems-api/excelexporters/energystoragepowerstationreportingrevenue.py - About 6 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_post has a Cognitive Complexity of 40 (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/meter.py - About 6 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

                              File meterenergy.py has 416 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/meterenergy.py - About 6 hrs to fix

                                Function Xa has 149 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                            Xa = function(b, c, d) {
                                              var g =
                                                '<li iui-class="{{data[' +
                                                b +
                                                '].style.general}}" data-index="{{data[' +
                                Severity: Major
                                Found in myems-admin/js/jcui/angular.integralui.treeview.min.js - About 5 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language