Showing 5,781 of 10,536 total issues

Function deps has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

                                function ($ocLazyLoad) {
                                    return $ocLazyLoad.load(['ui.select', 'ui.checkbox', 'daterangepicker', 'toaster']).then(
                                        function () {
                                            return $ocLazyLoad.load([{
                                                serie: true,
Severity: Major
Found in myems-admin/app/config.router.js - About 2 hrs to fix

    Function refreshInterval has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        this.refreshInterval = setInterval(() => {
          let isResponseOK = false;
          fetch(APIBaseURL + '/reports/meterrealtime?meterid=' + this.props.meterId, {
            method: 'GET',
            headers: {
    Severity: Major
    Found in myems-web/src/components/MyEMS/Meter/RealtimeChart.js - About 2 hrs to fix

      Function Combo has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const Combo = () => {
        const { setIsOpenSidePanel } = useContext(AppContext);
      
        return (
          <Fragment>
      Severity: Major
      Found in myems-web/src/components/bootstrap-components/Combo.js - About 2 hrs to fix

        Function on_put has 51 lines of code (exceeds 25 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: Major
        Found in myems-api/core/energystoragepowerstation.py - About 2 hrs to fix

          Function on_post has 51 lines of code (exceeds 25 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: Major
          Found in myems-api/core/energystoragepowerstation.py - About 2 hrs to fix

            Function on_get has 51 lines of code (exceeds 25 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: Major
            Found in myems-api/core/space.py - About 2 hrs to fix

              File SentRegisterEmailMessageForm.js has 251 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React, { useState, useEffect, useRef, useContext } from 'react';
              import PropTypes from 'prop-types';
              import { toast } from 'react-toastify';
              import { Button, Form, FormGroup, Input, Row, Col, Label, InputGroup, InputGroupAddon } from 'reactstrap';
              import withRedirect from '../../../hoc/withRedirect';
              Severity: Minor
              Found in myems-web/src/components/MyEMS/auth/SentRegisterEmailMessageForm.js - About 2 hrs to fix

                Function render has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        this.render = function(collection) {
                          collection = collection || {};
                
                          renderLater = false;
                          cachedCollection = collection;
                Severity: Minor
                Found in myems-admin/js/angular/angular-messages.js - About 2 hrs to fix

                  Consider simplifying this complex logical expression.
                  Open

                    "pluralCat": function(n, opt_precision) {  var i = n | 0;  var vf = getVF(n, opt_precision);  if (i == 1 && vf.v == 0) {    return PLURAL_CATEGORY.ONE;  }  if (vf.v == 0 && i % 10 >= 2 && i % 10 <= 4 && (i % 100 < 12 || i % 100 > 14)) {    return PLURAL_CATEGORY.FEW;  }  if (vf.v == 0 && i != 1 && i % 10 >= 0 && i % 10 <= 1 || vf.v == 0 && i % 10 >= 5 && i % 10 <= 9 || vf.v == 0 && i % 100 >= 12 && i % 100 <= 14) {    return PLURAL_CATEGORY.MANY;  }  return PLURAL_CATEGORY.OTHER;}
                  Severity: Critical
                  Found in myems-admin/js/angular/i18n/angular-locale_pl.js - About 2 hrs to fix

                    Consider simplifying this complex logical expression.
                    Open

                      "pluralCat": function(n, opt_precision) {  var i = n | 0;  var vf = getVF(n, opt_precision);  if (i == 1 && vf.v == 0) {    return PLURAL_CATEGORY.ONE;  }  if (vf.v == 0 && i % 10 >= 2 && i % 10 <= 4 && (i % 100 < 12 || i % 100 > 14)) {    return PLURAL_CATEGORY.FEW;  }  if (vf.v == 0 && i != 1 && i % 10 >= 0 && i % 10 <= 1 || vf.v == 0 && i % 10 >= 5 && i % 10 <= 9 || vf.v == 0 && i % 100 >= 12 && i % 100 <= 14) {    return PLURAL_CATEGORY.MANY;  }  return PLURAL_CATEGORY.OTHER;}
                    Severity: Critical
                    Found in myems-admin/js/angular/i18n/angular-locale_pl-pl.js - About 2 hrs to fix

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

                              "[": function link( text ) {
                      
                                  var orig = String(text);
                                  // Inline content is possible inside `link text`
                                  var res = Markdown.DialectHelpers.inline_until_char.call( this, text.substr(1), ']' );
                      Severity: Minor
                      Found in myems-admin/js/plugins/bootstrap-markdown/markdown.js - About 2 hrs to fix

                        Function _init has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                this._init = function _init(element) {
                                    // this is probably useless now because we override angular.bootstrap
                                    if (modulesToLoad.length === 0) {
                                        var elements = [element],
                                            names = ['ng:app', 'ng-app', 'x-ng-app', 'data-ng-app'],
                        Severity: Minor
                        Found in myems-admin/js/plugins/oclazyload/ocLazyLoad.js - About 2 hrs to fix

                          Function init has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  e.name = "Footable LucidBookmarkable", e.init = function(e) {
                                      e.options.bookmarkable.enabled && t(e.table).bind({
                                          footable_initialized: function() {
                                              var i = e.table.id,
                                                  o = a(i + "_f"),
                          Severity: Minor
                          Found in myems-admin/js/plugins/footable/footable.all.min.js - About 2 hrs to fix

                            Function render has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            jvm.Legend.prototype.render = function(){
                              var ticks = this.series.scale.getTicks(),
                                  i,
                                  inner = jvm.$('<div/>').addClass('jvectormap-legend-inner'),
                                  tick,
                            Severity: Minor
                            Found in myems-admin/js/plugins/jvectormap/jquery-jvectormap-2.0.2.min.js - About 2 hrs to fix

                              Function editTenant has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  $scope.editTenant = function (tenant) {
                                      var modalInstance = $uibModal.open({
                                          windowClass: "animated fadeIn",
                                          templateUrl: 'views/settings/tenant/tenant.model.html',
                                          controller: 'ModalEditTenantCtrl',
                              Severity: Minor
                              Found in myems-admin/app/controllers/settings/tenant/tenant.controller.js - About 2 hrs to fix

                                Function addTenant has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    $scope.addTenant = function () {
                                        var modalInstance = $uibModal.open({
                                            templateUrl: 'views/settings/tenant/tenant.model.html',
                                            controller: 'ModalAddTenantCtrl',
                                            windowClass: "animated fadeIn",
                                Severity: Minor
                                Found in myems-admin/app/controllers/settings/tenant/tenant.controller.js - About 2 hrs to fix

                                  Function editVirtualMeter has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      $scope.editVirtualMeter = function(virtualmeter) {
                                          var modalInstance = $uibModal.open({
                                              windowClass: "animated fadeIn",
                                              templateUrl: 'views/settings/meter/virtualmeter.model.html',
                                              controller: 'ModalEditVirtualMeterCtrl',
                                  Severity: Minor
                                  Found in myems-admin/app/controllers/settings/meter/virtualmeter.controller.js - About 2 hrs to fix

                                    Function refreshInterval has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        this.refreshInterval = setInterval(() => {
                                          let isResponseOK = false;
                                          fetch(APIBaseURL + '/reports/spaceenvironmentmonitor?sensorid=' + this.props.sensorId, {
                                            method: 'GET',
                                            headers: {
                                    Severity: Minor
                                    Found in myems-web/src/components/MyEMS/Space/RealtimeData.js - About 2 hrs to fix

                                      Function on_get has 50 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: Minor
                                      Found in myems-api/reports/energyflowdiagram.py - About 2 hrs to fix

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

                                        def generate_excel(report,
                                                           name,
                                                           reporting_start_datetime_local,
                                                           reporting_end_datetime_local,
                                                           period_type,
                                        Severity: Minor
                                        Found in myems-api/excelexporters/metertrend.py - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language