Showing 5,781 of 10,536 total issues

Function export has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

def export(report,
Severity: Major
Found in myems-api/excelexporters/spaceenergyitem.py - About 1 hr to fix

    Function generate_excel has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def generate_excel(report,
    Severity: Major
    Found in myems-api/excelexporters/combinedequipmentstatistics.py - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

          if "associated_equipment" not in report.keys() or \
                  "energy_category_names" not in report['associated_equipment'].keys() or \
                  len(report['associated_equipment']["energy_category_names"]) == 0 \
                  or 'associated_equipment_names_array' not in report['associated_equipment'].keys() \
                  or report['associated_equipment']['associated_equipment_names_array'] is None \
      Severity: Major
      Found in myems-api/excelexporters/combinedequipmentplan.py - About 1 hr to fix

        Function generate_excel has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def generate_excel(report,
        Severity: Major
        Found in myems-api/excelexporters/spacecost.py - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

              if "child_space" not in report.keys() or "energy_item_names" not in report['child_space'].keys() or \
                      len(report['child_space']["energy_item_names"]) == 0 \
                      or 'child_space_names_array' not in report['child_space'].keys() \
                      or report['child_space']['child_space_names_array'] is None \
                      or len(report['child_space']['child_space_names_array']) == 0 \
          Severity: Major
          Found in myems-api/excelexporters/spaceenergyitem.py - About 1 hr to fix

            Function export has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def export(report,
            Severity: Major
            Found in myems-api/excelexporters/spaceoutput.py - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                  if 'values' not in reporting_period_data.keys() or \
                          reporting_period_data['values'] is None or \
                          len(reporting_period_data['values']) == 0 or \
                          'timestamps' not in reporting_period_data.keys() or \
                          reporting_period_data['timestamps'] is None or \
              Severity: Major
              Found in myems-api/excelexporters/spaceoutput.py - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                    if "child_space" not in report.keys() or "energy_category_names" not in report['child_space'].keys() or \
                            len(report['child_space']["energy_category_names"]) == 0 \
                            or 'child_space_names_array' not in report['child_space'].keys() \
                            or report['child_space']['child_space_names_array'] is None \
                            or len(report['child_space']['child_space_names_array']) == 0 \
                Severity: Major
                Found in myems-api/excelexporters/spaceoutput.py - About 1 hr to fix

                  Function generate_excel has 8 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def generate_excel(report,
                  Severity: Major
                  Found in myems-api/excelexporters/storestatistics.py - About 1 hr to fix

                    Function export has 8 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def export(report,
                    Severity: Major
                    Found in myems-api/excelexporters/offlinemeterplan.py - About 1 hr to fix

                      Function generate_excel has 8 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def generate_excel(report,
                      Severity: Major
                      Found in myems-api/excelexporters/combinedequipmentplan.py - About 1 hr to fix

                        Function generate_excel has 8 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def generate_excel(report,
                        Severity: Major
                        Found in myems-api/excelexporters/spaceenergyitem.py - About 1 hr to fix

                          Function export has 8 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          def export(report,
                          Severity: Major
                          Found in myems-api/excelexporters/combinedequipmentstatistics.py - About 1 hr to fix

                            Consider simplifying this complex logical expression.
                            Open

                                if "associated_equipment" not in report.keys() or \
                                        "energy_category_names" not in report['associated_equipment'].keys() or \
                                        len(report['associated_equipment']["energy_category_names"]) == 0 \
                                        or 'associated_equipment_names_array' not in report['associated_equipment'].keys() \
                                        or report['associated_equipment']['associated_equipment_names_array'] is None \
                            Severity: Major
                            Found in myems-api/excelexporters/combinedequipmentstatistics.py - About 1 hr to fix

                              Consider simplifying this complex logical expression.
                              Open

                                  if "child_space" not in report.keys() or "energy_category_names" not in report['child_space'].keys() or \
                                          len(report['child_space']["energy_category_names"]) == 0 \
                                          or 'child_space_names_array' not in report['child_space'].keys() \
                                          or report['child_space']['energy_category_names'] is None \
                                          or len(report['child_space']['child_space_names_array']) == 0 \
                              Severity: Major
                              Found in myems-api/excelexporters/spacecost.py - About 1 hr to fix

                                Function generate_excel has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                def generate_excel(report,
                                Severity: Major
                                Found in myems-api/excelexporters/spaceoutput.py - About 1 hr to fix

                                  Function setAttributes has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    setAttributes: function(key, attr){
                                      var attrs = key,
                                          code;
                                  
                                      if (typeof key == 'string') {
                                  Severity: Minor
                                  Found in myems-admin/js/plugins/jvectormap/jquery-jvectormap-2.0.2.min.js - About 55 mins 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 setScale has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    setScale: function(scale, anchorX, anchorY, isCentered, animate) {
                                      var viewportChangeEvent = jvm.$.Event('zoom.jvectormap'),
                                          interval,
                                          that = this,
                                          i = 0,
                                  Severity: Minor
                                  Found in myems-admin/js/plugins/jvectormap/jquery-jvectormap-2.0.2.min.js - About 55 mins 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 applyTransform has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    applyTransform: function() {
                                      var maxTransX,
                                          maxTransY,
                                          minTransX,
                                          minTransY;
                                  Severity: Minor
                                  Found in myems-admin/js/plugins/jvectormap/jquery-jvectormap-2.0.2.min.js - About 55 mins 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 ProductGrid has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  const ProductGrid = ({
                                    id,
                                    files,
                                    title,
                                    category,
                                  Severity: Minor
                                  Found in myems-web/src/components/e-commerce/product/ProductGrid.js - About 55 mins 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