Showing 5,781 of 10,536 total issues

File Tables.js has 295 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { Fragment } from 'react';
import { Button, Card, CardBody, CardHeader, Col, Row } from 'reactstrap';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import PageHeader from '../common/PageHeader';
import FalconEditor from '../common/FalconEditor';
Severity: Minor
Found in myems-web/src/components/bootstrap-components/Tables.js - About 3 hrs to fix

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

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

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

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

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

        'use strict';
        
        app.controller('WindFarmController', function(
            $scope,
            $rootScope,
        Severity: Minor
        Found in myems-admin/app/controllers/settings/windfarm/windfarm.controller.js - About 3 hrs to fix

          Function getLostPoint has 76 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _this.getLostPoint = function(qrcode) {
          
                var moduleCount = qrcode.getModuleCount();
          
                var lostPoint = 0;
          Severity: Major
          Found in myems-admin/js/angular/qrcode.js - About 3 hrs to fix

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

                            link: function(scope, element, attr, ngModel) {
                                var chosen, defaultText, disableWithMessage, empty, initOrUpdate, match, options, origRender, removeEmptyMessage, startLoading, stopLoading, valuesExpr, viewWatch;
                                element.addClass('localytics-chosen');
                                options = scope.$eval(attr.chosen) || {};
                                angular.forEach(attr, function(value, key) {
            Severity: Major
            Found in myems-admin/js/plugins/chosen/chosen.js - About 3 hrs to fix

              Function addEnergyStorageContainerFirecontrol has 76 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    $scope.addEnergyStorageContainerFirecontrol = function() {
              
                        var modalInstance = $uibModal.open({
                            templateUrl: 'views/settings/energystoragecontainer/energystoragecontainerfirecontrol.model.html',
                            controller: 'ModalAddEnergyStorageContainerFirecontrolCtrl',

                Function loadData has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  const loadData = () => {
                
                    let is_logged_in = getCookieValue('is_logged_in');
                    let user_name = getCookieValue('user_name');
                    let user_display_name = getCookieValue('user_display_name');

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

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

                      Function generate_excel has 76 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/equipmentload.py - About 3 hrs to fix

                        File offlinemeterenergy.py has 293 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        from datetime import datetime, timedelta, timezone
                        from decimal import Decimal
                        import falcon
                        import mysql.connector
                        import simplejson as json
                        Severity: Minor
                        Found in myems-api/reports/offlinemeterenergy.py - About 3 hrs to fix

                          Function ResolveContext has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              var ResolveContext = /** @class */ (function () {
                                  function ResolveContext(_path) {
                                      this._path = _path;
                                  }
                                  /** Gets all the tokens found in the resolve context, de-duplicated */
                          Severity: Major
                          Found in myems-admin/js/ui-router/angular-ui-router.js - About 3 hrs to fix

                            Function compile has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                compile: function(elem, attr) {
                                  if (attr.hasOwnProperty(ARIA_DISABLE_ATTR)) return;
                            
                                  var shape = getShape(attr, elem);
                            
                            
                            Severity: Major
                            Found in myems-admin/js/angular/angular-aria.js - About 3 hrs to fix

                              Function interceptor has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  var interceptor = ['$q', '$cacheFactory', '$timeout', '$rootScope', '$log', 'cfpLoadingBar', function ($q, $cacheFactory, $timeout, $rootScope, $log, cfpLoadingBar) {
                              
                                    /**
                                     * The total number of requests made
                                     */
                              Severity: Major
                              Found in myems-admin/js/plugins/angular-loading-bar/loading-bar.js - About 3 hrs to fix

                                Function uploadFiles has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    value: function uploadFiles(files) {
                                      var _this15 = this;
                                
                                      this._transformFiles(files, function (transformedFiles) {
                                        if (_this15.options.chunking) {
                                Severity: Major
                                Found in myems-admin/js/plugins/dropzone/dropzone.js - About 3 hrs to fix

                                  Function buildEvent has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      function buildEvent(data, source) { // source may be undefined!
                                          var out = {};
                                          var start;
                                          var end;
                                          var allDay;
                                  Severity: Major
                                  Found in myems-admin/js/plugins/fullcalendar/fullcalendar.js - About 3 hrs to fix

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

                                      const handleSubmit = e => {
                                        e.preventDefault();
                                        console.log('handleSubmit');
                                        console.log(startDatetime.format('YYYY-MM-DDTHH:mm:ss'));
                                        console.log(endDatetime.format('YYYY-MM-DDTHH:mm:ss'));
                                    Severity: Major
                                    Found in myems-web/src/components/MyEMS/Notification/Notification.js - About 3 hrs to fix

                                      Function generate_excel has 75 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/combinedequipmentload.py - About 3 hrs to fix

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

                                        'use strict';
                                        
                                        app.controller('EnergyFlowDiagramLinkController', function(
                                            $scope,
                                            $rootScope,
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language