Showing 5,781 of 10,536 total issues

File shopfloorstatistics.py has 722 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/shopfloorstatistics.py - About 1 day to fix

    Function $$AnimationProvider has 333 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var $$AnimationProvider = ['$animateProvider', /** @this */ function($animateProvider) {
      var NG_ANIMATE_REF_ATTR = 'ng-animate-ref';
    
      var drivers = this.drivers = [];
    
    
    Severity: Major
    Found in myems-admin/js/angular/angular-animate.js - About 1 day to fix

      File equipmentplan.py has 721 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/equipmentplan.py - About 1 day to fix

        File equipmentsaving.py has 721 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/equipmentsaving.py - About 1 day to fix

          Function o has 332 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              k.o = function () {
                  var s = this;
          
                  this.o = null; // array of options
                  this.$ = null; // jQuery wrapped element
          Severity: Major
          Found in myems-admin/js/plugins/jsKnob/jquery.knob.js - About 1 day to fix

            File equipmentefficiency.py has 720 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: Major
            Found in myems-api/reports/equipmentefficiency.py - About 1 day to fix

              File spacesaving.py has 719 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: Major
              Found in myems-api/reports/spacesaving.py - About 1 day to fix

                File spaceplan.py has 719 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: Major
                Found in myems-api/reports/spaceplan.py - About 1 day to fix

                  Function on_get has a Cognitive Complexity of 83 (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/virtualmeterenergy.py - About 1 day 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 83 (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/store.py - About 1 day 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 storestatistics.py has 716 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import base64
                  from core.utilities import get_translation
                  import os
                  import uuid
                  import openpyxl.utils.cell as format_cell
                  Severity: Major
                  Found in myems-api/excelexporters/storestatistics.py - About 1 day to fix

                    Function View has 329 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function View(element, calendar, viewName) {
                            var t = this;
                    
                    
                            // exports
                    Severity: Major
                    Found in myems-admin/js/plugins/fullcalendar/fullcalendar.min.js - About 1 day to fix

                      File combinedequipmentsaving.py has 715 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: Major
                      Found in myems-api/reports/combinedequipmentsaving.py - About 1 day to fix

                        File combinedequipmentplan.py has 715 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: Major
                        Found in myems-api/reports/combinedequipmentplan.py - About 1 day to fix

                          File equipmentincome.py has 714 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/equipmentincome.py - About 1 day to fix

                            File spaceenergyitem.py has 706 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/spaceenergyitem.py - About 1 day to fix

                              Function highchart has 323 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                function highchart(highchartsNGUtils, $timeout) {
                              
                                  // acceptable shared state
                                  var seriesId = 0;
                                  var ensureIds = function (series) {
                              Severity: Major
                              Found in myems-admin/js/angular-highcharts/highcharts-ng.js - About 1 day to fix

                                File MicrogridDetails.js has 705 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                import React, { Fragment, useState, useEffect, useContext } from 'react';
                                import {
                                  Card,
                                  CardBody,
                                  Col,
                                Severity: Major
                                Found in myems-web/src/components/MyEMS/Microgrid/MicrogridDetails.js - About 1 day to fix

                                  File equipmentload.py has 702 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/equipmentload.py - About 1 day to fix

                                    Function on_get has a Cognitive Complexity of 80 (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/metertrend.py - About 1 day 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