Showing 5,781 of 10,536 total issues

Function _fetchEventSource has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function _fetchEventSource(source, callback) {
            var i;
            var fetchers = fc.sourceFetchers;
            var res;
            for (i=0; i<fetchers.length; i++) {
Severity: Major
Found in myems-admin/js/plugins/fullcalendar/fullcalendar.min.js - About 2 hrs to fix

    Function ModalCommentContent has 74 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const ModalCommentContent = () => {
      return (
        <>
          <Media>
            <Avatar src={users[3].avatar.src} className="mr-2" size="l" />
    Severity: Major
    Found in myems-web/src/components/kanban/ModalCommentContetn.js - About 2 hrs to fix

      Function on_get has 74 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/offlinemeterenergy.py - About 2 hrs to fix

        File virtualpoint.py has 289 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import json
        import random
        import re
        import time
        from datetime import datetime
        Severity: Minor
        Found in myems-normalization/virtualpoint.py - About 2 hrs to fix

          Function StateBuilder has 73 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              var StateBuilder = /** @class */ (function () {
                  function StateBuilder(matcher, urlMatcherFactory) {
                      this.matcher = matcher;
                      var self = this;
                      var root = function () { return matcher.find(''); };
          Severity: Major
          Found in myems-admin/js/ui-router/angular-ui-router.js - About 2 hrs to fix

            Function Emitter has 73 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function () {
              function Emitter() {
                _classCallCheck(this, Emitter);
              }
            
            
            Severity: Major
            Found in myems-admin/js/plugins/dropzone/dropzone.js - About 2 hrs to fix

              Function _loadDependencies has 73 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                              _loadDependencies: function _loadDependencies(moduleName, localParams) {
                                  var loadedModule,
                                      requires,
                                      diff,
                                      promisesList = [],
              Severity: Major
              Found in myems-admin/js/plugins/oclazyload/ocLazyLoad.js - About 2 hrs to fix

                Function register_observers has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        Chosen.prototype.register_observers = function() {
                            var _this = this;
                            this.container.bind('mousedown.chosen', function(evt) {
                                _this.container_mousedown(evt);
                            });
                Severity: Major
                Found in myems-admin/js/plugins/chosen/chosen.jquery.js - About 2 hrs to fix

                  Function Ab has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                            var Ab = function() {
                                var b = q(function() {
                                  P = m[0].offsetWidth - 6;
                                  sa = m[0].offsetHeight - 4;
                                  C.css("top", H[0].offsetHeight + 2 + "px");
                  Severity: Major
                  Found in myems-admin/js/jcui/angular.integralui.treeview.min.js - About 2 hrs to fix

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

                      const loadData = url => {
                        console.log('url:' + url);
                        // disable submit button
                        setSubmitButtonDisabled(true);
                        // show spinner

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

                        render() {
                          const chartData = {
                            ...this.state.chartData,
                            datasets: [
                              {
                      Severity: Major
                      Found in myems-web/src/components/dashboard/ActiveUsersBarChart.js - About 2 hrs to fix

                        Function isBrowserSupported has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                        Open

                        Dropzone.isBrowserSupported = function () {
                          var capableBrowser = true;
                        
                          if (window.File && window.FileReader && window.FileList && window.Blob && window.FormData && document.querySelector) {
                            if (!("classList" in document.createElement("a"))) {
                        Severity: Minor
                        Found in myems-admin/js/plugins/dropzone/dropzone.js - 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 21 (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/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_post has a Cognitive Complexity of 21 (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/photovoltaicpowerstation.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_post has a Cognitive Complexity of 21 (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/photovoltaicpowerstation.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_post has a Cognitive Complexity of 21 (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/windfarm.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_post has a Cognitive Complexity of 21 (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/windfarm.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 21 (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/tariff.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 21 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def on_get(req, resp):
                                admin_control(req)
                                cnx = mysql.connector.connect(**config.myems_user_db)
                                cursor = cnx.cursor()
                                query = (" SELECT u.id, u.name, u.display_name, u.uuid, "
                        Severity: Minor
                        Found in myems-api/core/user.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 21 (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:
                        Severity: Minor
                        Found in myems-api/core/user.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