Showing 5,781 of 10,536 total issues

Function CookieNotice has 138 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const CookieNotice = () => {
  const [visible, setVisible] = useState(false);
  const onDismiss = () => setVisible(false);

  return (
Severity: Major
Found in myems-web/src/components/bootstrap-components/CookieNotice.js - About 5 hrs to fix

    File equipment_energy_input_item.py has 394 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import random
    import time
    from datetime import datetime, timedelta
    from decimal import Decimal
    from multiprocessing import Pool
    Severity: Minor
    Found in myems-aggregation/equipment_energy_input_item.py - About 5 hrs to fix

      Function BillingContent has 136 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const BillingContent = () => {
        const [method, setMethod] = useState('card');
        const [cardNumber, setCardNumber] = useState('');
        const [cardName, setCardName] = useState('');
        const [country, setCountry] = useState('United States');
      Severity: Major
      Found in myems-web/src/components/page/Billing.js - About 5 hrs to fix

        Function Emitter has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
        Open

        function () {
          function Emitter() {
            _classCallCheck(this, Emitter);
          }
        
        
        Severity: Minor
        Found in myems-admin/js/plugins/dropzone/dropzone.js - About 5 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 36 (exceeds 5 allowed). Consider refactoring.
        Open

            def on_post(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/offlinemeterinput.py - About 5 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 36 (exceeds 5 allowed). Consider refactoring.
        Open

            def on_put(req, resp):
                """Handles PUT requests"""
                try:
                    raw_json = req.stream.read().decode('utf-8')
                    new_values = json.loads(raw_json)
        Severity: Minor
        Found in myems-api/core/user.py - About 5 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 start has 135 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              function start() {
                if (animationClosed) return;
                if (!node.parentNode) {
                  close();
                  return;
        Severity: Major
        Found in myems-admin/js/angular/angular-animate.js - About 5 hrs to fix

          Function on_get has 135 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/spaceenergycategory.py - About 5 hrs to fix

            File tenant_energy_input_item.py has 391 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import random
            import time
            from datetime import datetime, timedelta
            from decimal import Decimal
            from multiprocessing import Pool
            Severity: Minor
            Found in myems-aggregation/tenant_energy_input_item.py - About 5 hrs to fix

              File equipment_energy_output_category.py has 391 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import random
              import time
              from datetime import datetime, timedelta
              from decimal import Decimal
              from multiprocessing import Pool
              Severity: Minor
              Found in myems-aggregation/equipment_energy_output_category.py - About 5 hrs to fix

                File equipment_energy_input_category.py has 391 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import random
                import time
                from datetime import datetime, timedelta
                from decimal import Decimal
                from multiprocessing import Pool
                Severity: Minor
                Found in myems-aggregation/equipment_energy_input_category.py - About 5 hrs to fix

                  File store_energy_input_item.py has 391 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import random
                  import time
                  from datetime import datetime, timedelta
                  from decimal import Decimal
                  from multiprocessing import Pool
                  Severity: Minor
                  Found in myems-aggregation/store_energy_input_item.py - About 5 hrs to fix

                    Function run has 134 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            this.run = function () {
                                var cf = function (e, conf) {
                                    var k;
                                    for (k in conf) {
                                        s.o[k] = conf[k];
                    Severity: Major
                    Found in myems-admin/js/plugins/jsKnob/jquery.knob.js - About 5 hrs to fix

                      Function on_get has 134 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/spaceefficiency.py - About 5 hrs to fix

                        File tenant_energy_input_category.py has 388 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import random
                        import time
                        from datetime import datetime, timedelta
                        from decimal import Decimal
                        from multiprocessing import Pool
                        Severity: Minor
                        Found in myems-aggregation/tenant_energy_input_category.py - About 5 hrs to fix

                          File store_energy_input_category.py has 388 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import random
                          import time
                          from datetime import datetime, timedelta
                          from decimal import Decimal
                          from multiprocessing import Pool
                          Severity: Minor
                          Found in myems-aggregation/store_energy_input_category.py - About 5 hrs to fix

                            Function ViewService has 132 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                var ViewService = /** @class */ (function () {
                                    /** @internal */
                                    function ViewService(/** @internal */ router) {
                                        var _this = this;
                                        this.router = router;
                            Severity: Major
                            Found in myems-admin/js/ui-router/angular-ui-router.js - About 5 hrs to fix

                              Function editEnergyStorageContainerHVAC has 132 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                    $scope.editEnergyStorageContainerHVAC = function(energystoragecontainerhvac) {
                                        var modalInstance = $uibModal.open({
                                            templateUrl: 'views/settings/energystoragecontainer/energystoragecontainerhvac.model.html',
                                            controller: 'ModalEditEnergyStorageContainerHVACCtrl',
                                          windowClass: "animated fadeIn",

                                Function name has 131 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                          Resource[name] = function(a1, a2, a3, a4) {
                                            var params = {}, data, onSuccess, onError;
                                
                                            switch (arguments.length) {
                                              case 4:
                                Severity: Major
                                Found in myems-admin/js/angular/angular-resource.js - About 5 hrs to fix

                                  Function addEnergyStorageContainerHVAC has 131 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                        $scope.addEnergyStorageContainerHVAC = function() {
                                  
                                            var modalInstance = $uibModal.open({
                                                templateUrl: 'views/settings/energystoragecontainer/energystoragecontainerhvac.model.html',
                                                controller: 'ModalAddEnergyStorageContainerHVACCtrl',
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language