Showing 5,781 of 10,536 total issues

File jquery.slimscroll.js has 299 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*! Copyright (c) 2011 Piotr Rochala (http://rocha.la)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Version: 1.3.6
Severity: Minor
Found in myems-admin/js/plugins/slimscroll/jquery.slimscroll.js - About 3 hrs to fix

    Function StateQueueManager has 79 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        var StateQueueManager = /** @class */ (function () {
            function StateQueueManager(router, states, builder, listeners) {
                this.router = router;
                this.states = states;
                this.builder = builder;
    Severity: Major
    Found in myems-admin/js/ui-router/angular-ui-router.js - About 3 hrs to fix

      Function $httpBackend has 79 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function $httpBackend(method, url, data, callback, headers, timeout, withCredentials, responseType, eventHandlers, uploadEventHandlers) {
      
          var xhr = new MockXhr(),
              expectation = expectations[0],
              wasExpected = false;
      Severity: Major
      Found in myems-admin/js/angular/angular-mocks.js - About 3 hrs to fix

        Function resizableDayEvent has 79 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function resizableDayEvent(event, element, segment) {
                    var isRTL = opt('isRTL');
                    var direction = isRTL ? 'w' : 'e';
                    var handle = element.find('.ui-resizable-' + direction); // TODO: stop using this class because we aren't using jqui for this
                    var isResizing = false;
        Severity: Major
        Found in myems-admin/js/plugins/fullcalendar/fullcalendar.min.js - About 3 hrs to fix

          Function Aa has 79 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                var Aa = function(a) {
                  if (a) {
                    var c = a.general;
                    c = f.isString(c)
                      ? c
          Severity: Major
          Found in myems-admin/js/jcui/angular.integralui.treeview.min.js - About 3 hrs to fix

            Function La has 79 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                      var La = function(b, c) {
                          a.labelEditStatus() && a.closeEditor();
                          b.preventDefault();
                          var d = !0;
                          b.dataTransfer
            Severity: Major
            Found in myems-admin/js/jcui/angular.integralui.treeview.min.js - About 3 hrs to fix

              Function handleSubmit has 79 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                const handleSubmit = e => {
                  e.preventDefault();
                  console.log('handleSubmit');
                  console.log(priority);
                  console.log(status);
              Severity: Major
              Found in myems-web/src/components/MyEMS/FDD/Fault.js - About 3 hrs to fix

                Function on_get has 79 lines of code (exceeds 25 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: Major
                Found in myems-api/reports/microgridsbilling.py - About 3 hrs to fix

                  Function on_get has 79 lines of code (exceeds 25 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: Major
                  Found in myems-api/reports/energystoragepowerstationcollectionbilling.py - About 3 hrs to fix

                    Function on_get has 79 lines of code (exceeds 25 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: Major
                    Found in myems-api/reports/microgridscarbon.py - About 3 hrs to fix

                      Function on_get has 79 lines of code (exceeds 25 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: Major
                      Found in myems-api/reports/energystoragepowerstationreportingparameters.py - About 3 hrs to fix

                        Function on_get has 79 lines of code (exceeds 25 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: Major
                        Found in myems-api/reports/energystoragepowerstationcollectioncarbon.py - About 3 hrs to fix

                          Function on_get has 79 lines of code (exceeds 25 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: Major
                          Found in myems-api/reports/microgridsenergy.py - About 3 hrs to fix

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

                            'use strict';
                            
                            app.controller('CombinedEquipmentParameterController', function (
                                $scope,
                                $rootScope,

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

                              'use strict';
                              
                              app.controller('AdvancedReportController', function(
                                  $scope,
                                  $rootScope,

                                Function getMergedOptions has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    var getMergedOptions = function (scope, element, config) {
                                      var mergedOptions = {};
                                
                                      var defaultOptions = {
                                        chart: {
                                Severity: Major
                                Found in myems-admin/js/angular-highcharts/highcharts-ng.js - About 3 hrs to fix

                                  Function EmojiMart has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  const EmojiMart = () => {
                                    const emojiMartCode = `function() {
                                      const [previewEmojiTextarea, setPreviewEmojiTextarea] = useState(false);
                                      const { isDark } = useContext(AppContext);
                                      const [message, setMessage] = useState('');
                                  Severity: Major
                                  Found in myems-web/src/components/plugins/EmojiMart.js - About 3 hrs to fix

                                    Function contentLoaded has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    var contentLoaded = function contentLoaded(win, fn) {
                                      var done = false;
                                      var top = true;
                                      var doc = win.document;
                                      var root = doc.documentElement;
                                    Severity: Minor
                                    Found in myems-admin/js/plugins/dropzone/dropzone.js - About 3 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 22 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        def on_get(req, resp, id_, pid):
                                            access_control(req)
                                            if not id_.isdigit() or int(id_) <= 0:
                                                raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                                                       description='API.INVALID_ENERGY_STORAGE_CONTAINER_ID')
                                    Severity: Minor
                                    Found in myems-api/core/energystoragecontainer.py - About 3 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 22 (exceeds 5 allowed). Consider refactoring.
                                    Open

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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language