Showing 5,781 of 10,536 total issues

File messages.js has 463 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import chatImg1 from '../../assets/img/chat/1.jpg';
import chatImg2 from '../../assets/img/chat/2.jpg';
import chatImg3 from '../../assets/img/chat/3.jpg';
import chatImg4 from '../../assets/img/chat/4.jpg';
import chatImg5 from '../../assets/img/chat/5.jpg';
Severity: Minor
Found in myems-web/src/data/chat/messages.js - About 7 hrs to fix

    Function on_post has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
    Open

        def on_post(req, resp, id_):
            """Handles POST requests"""
            admin_control(req)
            try:
                raw_json = req.stream.read().decode('utf-8')
    Severity: Minor
    Found in myems-api/core/energystoragecontainer.py - About 7 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 46 (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/space.py - About 7 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 46 (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/equipment.py - About 7 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 $get has 176 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

           function($animateCss,   $rootScope,   $$AnimateRunner,   $rootElement,   $sniffer,   $$jqLite,   $document) {
    
        // only browsers that support these properties can render animations
        if (!$sniffer.animations && !$sniffer.transitions) return noop;
    
    
    Severity: Major
    Found in myems-admin/js/angular/angular-animate.js - About 7 hrs to fix

      File costcenter.py has 460 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import uuid
      import falcon
      import mysql.connector
      import simplejson as json
      from core.useractivity import user_logger, admin_control, access_control, api_key_control
      Severity: Minor
      Found in myems-api/core/costcenter.py - About 7 hrs to fix

        Function draw has 175 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function draw(plot, newCtx) {
        
                    if (!target) {
                        return; // if no series were passed
                    }
        Severity: Major
        Found in myems-admin/js/plugins/flot/jquery.flot.pie.js - About 7 hrs to fix

          File equipmentoutput.py has 458 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: Minor
          Found in myems-api/reports/equipmentoutput.py - About 7 hrs to fix

            Function queueAnimation has 173 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function queueAnimation(originalElement, event, initialOptions) {
                  // we always make a copy of the options since
                  // there should never be any side effects on
                  // the input data when running `$animateCss`.
                  var options = copy(initialOptions);
            Severity: Major
            Found in myems-admin/js/angular/angular-animate.js - About 6 hrs to fix

              Function on_get has a Cognitive Complexity of 45 (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/offlinemeterdaily.py - About 6 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_put has a Cognitive Complexity of 45 (exceeds 5 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: Minor
              Found in myems-api/core/meter.py - About 6 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 45 (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/combinedequipment.py - About 6 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 45 (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/notification.py - About 6 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

              File Flex.js has 454 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React, { Fragment } from 'react';
              import { Card, CardHeader, CardBody } from 'reactstrap';
              import FalconEditor from '../common/FalconEditor';
              import PageHeader from '../common/PageHeader';
              
              
              Severity: Minor
              Found in myems-web/src/components/utilities/Flex.js - About 6 hrs to fix

                Function ProductDetailsFooter has 172 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const ProductDetailsFooter = () => {
                  const [activeTab, setActiveTab] = useState('description');
                  const [indicatorLeft, setIndicatorLeft] = useState(null);
                  const [indicatorRight, setIndicatorRight] = useState(null);
                  const [currentTabIndex, setCurrentTabIndex] = useState(null);

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

                  'use strict';
                  
                  app.controller('UserController', function ($scope,
                      $rootScope,
                      $window,
                  Severity: Minor
                  Found in myems-admin/app/controllers/users/user/user.controller.js - About 6 hrs to fix

                    File Buttons.js has 452 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

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

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

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

                        File metercomparison.py has 451 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: Minor
                        Found in myems-api/reports/metercomparison.py - About 6 hrs to fix

                          Function showEditor has 168 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            , showEditor: function() {
                                var instance = this,
                                    textarea,
                                    ns = this.$ns,
                                    container = this.$element,
                          Severity: Major
                          Found in myems-admin/js/plugins/bootstrap-markdown/bootstrap-markdown.js - About 6 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language