Showing 5,781 of 10,536 total issues

Function Ba has 87 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            Ba = function(b, c, d) {
              if (a.dragDropStatus())
                (d = B[0].value),
                  a.labelEditStatus(!1),
                  B.unbind("blur focus keydown mousedown"),
Severity: Major
Found in myems-admin/js/jcui/angular.integralui.treeview.min.js - About 3 hrs to fix

    Function handleAcknowledged has 87 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const handleAcknowledged = id => {
        console.log('Mark As Acknowledged: ', id);
        let isResponseOK = false;
        fetch(APIBaseURL + '/webmessages/' + id, {
          method: 'PUT',
    Severity: Major
    Found in myems-web/src/components/MyEMS/FDD/Fault.js - About 3 hrs to fix

      Function on_get has 87 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/offlinemetercarbon.py - About 3 hrs to fix

        Function on_get has 87 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/equipmentoutput.py - About 3 hrs to fix

          Function on_get has 87 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/offlinemetercost.py - About 3 hrs to fix

            Function on_get has 87 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/virtualmetercarbon.py - About 3 hrs to fix

              Function on_get has 87 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/virtualmetercost.py - About 3 hrs to fix

                Function generate_excel has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                def generate_excel(report,
                                   name,
                                   base_period_start_datetime_local,
                                   base_period_end_datetime_local,
                                   reporting_start_datetime_local,
                Severity: Major
                Found in myems-api/excelexporters/equipmentstatistics.py - About 3 hrs to fix

                  Function Param has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      var Param = /** @class */ (function () {
                          function Param(id, type, location, urlConfig, state) {
                              var config = getParamDeclaration(id, location, state);
                              type = getType(config, type, location, id, urlConfig.paramTypes);
                              var arrayMode = getArrayMode();
                  Severity: Major
                  Found in myems-admin/js/ui-router/angular-ui-router.js - About 3 hrs to fix

                    Function triggerAnimationStart has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            function triggerAnimationStart() {
                              // just incase a stagger animation kicks in when the animation
                              // itself was cancelled entirely
                              if (animationClosed) return;
                    
                    
                    Severity: Major
                    Found in myems-admin/js/angular/angular-animate.js - About 3 hrs to fix

                      Function insertLegend has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              function insertLegend() {
                      
                                  if (options.legend.container != null) {
                                      $(options.legend.container).html("");
                                  } else {
                      Severity: Major
                      Found in myems-admin/js/plugins/flot/jquery.flot.js - About 3 hrs to fix

                        Function markAsRead has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          const markAsRead = e => {
                            e.preventDefault();
                        
                            let isResponseOK = false;
                            fetch(APIBaseURL + '/webmessagesnew', {
                        Severity: Major
                        Found in myems-web/src/components/navbar/NotificationDropdown.js - About 3 hrs to fix

                          File equipments.js has 310 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import { v4 as uuid } from 'uuid';
                          
                          import product1 from './img/1.png';
                          import product2 from './img/2.png';
                          import product4 from './img/4.png';
                          Severity: Minor
                          Found in myems-web/src/components/MyEMS/Monitoring/equipments.js - About 3 hrs to fix

                            Function EventScheduleForm has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const EventScheduleForm = () => {
                              // State
                              const [title, setTitle] = useState('');
                              const [startDate, setStartDate] = useState(null);
                              const [startTime, setStartTime] = useState(null);
                            Severity: Major
                            Found in myems-web/src/components/event/EventScheduleForm.js - About 3 hrs to fix

                              Function handleRead has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                const handleRead = id => {
                                  console.log('Mark As Read: ', id);
                                  let isResponseOK = false;
                                  fetch(APIBaseURL + '/webmessages/' + id, {
                                    method: 'PUT',
                              Severity: Major
                              Found in myems-web/src/components/MyEMS/FDD/Fault.js - About 3 hrs to fix

                                Function discover has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                                Open

                                Dropzone.discover = function () {
                                  var dropzones;
                                
                                  if (document.querySelectorAll) {
                                    dropzones = document.querySelectorAll(".dropzone");
                                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 setFocus has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  setFocus: function(config){
                                    var bbox,
                                        itemBbox,
                                        newBbox,
                                        codes,
                                Severity: Minor
                                Found in myems-admin/js/plugins/jvectormap/jquery-jvectormap-2.0.2.min.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 24 (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/meter.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_post has a Cognitive Complexity of 24 (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/microgrid.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_post has a Cognitive Complexity of 24 (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/shopfloor.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