Showing 5,781 of 10,536 total issues

Function ngMessageDirectiveFactory has 70 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function ngMessageDirectiveFactory(isDefault) {
  return ['$animate', function($animate) {
    return {
      restrict: 'AE',
      transclude: 'element',
Severity: Major
Found in myems-admin/js/angular/angular-messages.js - About 2 hrs to fix

    Function SelectionManager has 70 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function SelectionManager() {
            var t = this;
    
    
            // exports
    Severity: Major
    Found in myems-admin/js/plugins/fullcalendar/fullcalendar.min.js - About 2 hrs to fix

      Function discover has 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Dropzone.discover = function () {
        var dropzones;
      
        if (document.querySelectorAll) {
          dropzones = document.querySelectorAll(".dropzone");
      Severity: Major
      Found in myems-admin/js/plugins/dropzone/dropzone.js - About 2 hrs to fix

        Function limitRow has 70 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            limitRow: function(row, levelLimit) {
                var _this = this;
                var view = this.view;
                var rowStruct = this.rowStructs[row];
                var moreNodes = []; // array of "more" <a> links and <td> DOM nodes
        Severity: Major
        Found in myems-admin/js/plugins/fullcalendar/fullcalendar.js - About 2 hrs to fix

          Function createThumbnailFromUrl has 70 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              value: function createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback, crossOrigin) {
                var _this14 = this;
          
                // Not using `new Image` here because of a bug in latest Chrome versions.
                // See https://github.com/enyo/dropzone/pull/226
          Severity: Major
          Found in myems-admin/js/plugins/dropzone/dropzone.js - About 2 hrs to fix

            Function ProgressBar has 70 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const ProgressBar = () => {
              return (
                <Fragment>
                  <PageHeader
                    title="Progress"
            Severity: Major
            Found in myems-web/src/components/bootstrap-components/ProgressBar.js - About 2 hrs to fix

              Function AddAnotherList has 70 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const AddAnotherList = () => {
                const { kanbanColumns, kanbanColumnsDispatch } = useContext(KanbanContext);
              
                const [showForm, setShowForm] = useState(false);
                const [columnHeaderTitle, setColumnHeaderTitle] = useState('');
              Severity: Major
              Found in myems-web/src/components/kanban/AddAnotherList.js - About 2 hrs to fix

                File Billing.js has 283 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import React, { useState } from 'react';
                import { Link } from 'react-router-dom';
                import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
                import {
                  Button,
                Severity: Minor
                Found in myems-web/src/components/page/Billing.js - About 2 hrs to fix

                  File SpaceEnvironmentMonitor.js has 282 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import React, { Fragment, useEffect, useState } from 'react';
                  import {
                    Breadcrumb,
                    BreadcrumbItem,
                    Card,
                  Severity: Minor
                  Found in myems-web/src/components/MyEMS/Space/SpaceEnvironmentMonitor.js - About 2 hrs to fix

                    Function post has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            post: function(scope, elem, attr, ngModel) {
                              var needsTabIndex = shouldAttachAttr('tabindex', 'tabindex', elem, false);
                    
                              function ngAriaWatchModelValue() {
                                return ngModel.$modelValue;
                    Severity: Major
                    Found in myems-admin/js/angular/angular-aria.js - About 2 hrs to fix

                      Function renderEventRow has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          renderEventRow: function(row, rowSegs) {
                              var view = this.view;
                              var colCnt = view.colCnt;
                              var segLevels = this.buildSegLevels(rowSegs); // group into sub-arrays of levels
                              var levelCnt = Math.max(1, segLevels.length); // ensure at least one level
                      Severity: Major
                      Found in myems-admin/js/plugins/fullcalendar/fullcalendar.js - About 2 hrs to fix

                        Function bindContainerTouchEvents has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          bindContainerTouchEvents: function(){
                            var touchStartScale,
                                touchStartDistance,
                                map = this,
                                touchX,
                        Severity: Major
                        Found in myems-admin/js/plugins/jvectormap/jquery-jvectormap-2.0.2.min.js - About 2 hrs to fix

                          Function EventTicket has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const EventTicket = () => {
                            // Data
                            const { loading: loadingTickets, data: tickets, setData: setTickets } = useFakeFetch(rawEventTickets);
                          
                            // Change Ticket
                          Severity: Major
                          Found in myems-web/src/components/event/EventTicket.js - About 2 hrs to fix

                            Function getOption has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const getOption = (data, colors, isDark) => {
                              const grays = getGrays(isDark);
                              return {
                                dataset: { source: data },
                                tooltip: {
                            Severity: Major
                            Found in myems-web/src/components/dashboard-alt/TopProducts.js - About 2 hrs to fix

                              Function on_post has a Cognitive Complexity of 20 (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/energystoragecontainer.py - About 2 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 20 (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/tenant.py - About 2 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 20 (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/tenant.py - About 2 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 20 (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/offlinemeter.py - About 2 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 20 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def on_put(req, resp, id_):
                                      """Handles PUT requests"""
                                      admin_control(req)
                                      if not id_.isdigit() or int(id_) <= 0:
                                          raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                              Severity: Minor
                              Found in myems-api/core/combinedequipment.py - About 2 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 20 (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/offlinemeter.py - About 2 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