Showing 5,781 of 10,536 total issues

File TenantBill.js has 607 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { Fragment, useEffect, useState, useContext } from 'react';
import PropTypes from 'prop-types';
import {
  Breadcrumb,
  BreadcrumbItem,
Severity: Major
Found in myems-web/src/components/MyEMS/Tenant/TenantBill.js - About 1 day to fix

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

                link: function (scope, element, attrs, ngModel) {
                    function prepareViews() {
                        scope.views = datePickerConfig.views.concat();
                        scope.view = attrs.view || datePickerConfig.view;
    
    
    Severity: Major
    Found in myems-admin/js/plugins/datapicker/angular-datepicker.js - About 1 day to fix

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

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

        Function $get has 259 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            this.$get = ['$http', '$log', '$q', '$timeout', function($http, $log, $q, $timeout) {
        
              var noop = angular.noop,
                  forEach = angular.forEach,
                  extend = angular.extend,
        Severity: Major
        Found in myems-admin/js/angular/angular-resource.js - About 1 day to fix

          Function setOptions has 258 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  setOptions: function(options, callback) {
          
                      this.startDate = moment().startOf('day');
                      this.endDate = moment().endOf('day');
                      this.timeZone = moment().utcOffset();
          Severity: Major
          Found in myems-admin/js/plugins/daterangepicker/daterangepicker.js - About 1 day to fix

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

              File sensor.py has 592 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import uuid
              from datetime import datetime, timedelta
              import falcon
              import mysql.connector
              import simplejson as json
              Severity: Major
              Found in myems-api/core/sensor.py - About 1 day to fix

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

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

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

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

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

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

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

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

                              /*!jQuery Knob*/
                              /**
                               * Downward compatible, touchable dial
                               *
                               * Version: 1.2.8
                              Severity: Major
                              Found in myems-admin/js/plugins/jsKnob/jquery.knob.js - About 1 day to fix

                                Function on_get has a Cognitive Complexity of 63 (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/core/virtualmeter.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 link has 247 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        link: function(b, f, m, a, t) {
                                          var g = this,
                                            e = f.children().eq(0),
                                            h = f.children().eq(1);
                                          b.$on("$destroy", function(a) {
                                Severity: Major
                                Found in myems-admin/js/jcui/angular.integralui.checkbox.min.js - About 1 day to fix

                                  File command.py has 577 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  import uuid
                                  from datetime import datetime, timedelta
                                  import falcon
                                  import mysql.connector
                                  import simplejson as json
                                  Severity: Major
                                  Found in myems-api/core/command.py - About 1 day to fix

                                    File Forms.js has 575 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    import React, { Fragment } from 'react';
                                    import { Button, Card, CardBody, Col, Row } from 'reactstrap';
                                    import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
                                    import FalconCardHeader from '../common/FalconCardHeader';
                                    import FalconEditor from '../common/FalconEditor';
                                    Severity: Major
                                    Found in myems-web/src/components/bootstrap-components/Forms.js - About 1 day to fix

                                      File combinedequipmentload.py has 573 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/combinedequipmentload.py - About 1 day to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language