Showing 10,536 of 10,536 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

          <ul>
            <li>
              <code>none</code>
            </li>
            <li>
Severity: Major
Found in myems-web/src/components/utilities/Display.js and 1 other location - About 1 day to fix
myems-web/src/components/utilities/Display.js on lines 194..222

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 246.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function View has 263 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function View(calendar) {
    var t = this;
    
    // exports
    t.calendar = calendar;
Severity: Major
Found in myems-admin/js/plugins/fullcalendar/fullcalendar.js - About 1 day to fix

    Identical blocks of code found in 2 locations. Consider refactoring.
    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/combinedequipmentload.py and 1 other location - About 1 day to fix
    myems-api/excelexporters/combinedequipmentefficiency.py on lines 941..948

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 151.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    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/combinedequipmentefficiency.py and 1 other location - About 1 day to fix
    myems-api/excelexporters/combinedequipmentload.py on lines 717..724

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 151.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

            if energy_category_set is not None and len(energy_category_set) > 0:
                for energy_category_id in energy_category_set:
                    result['child_space']['energy_category_names'].append(energy_category_dict[energy_category_id]['name'])
                    result['child_space']['units'].append('KG')
                    result['child_space']['child_space_names_array'].append(
    Severity: Major
    Found in myems-api/reports/spacecarbon.py and 1 other location - About 1 day to fix
    myems-api/reports/combinedequipmentcarbon.py on lines 654..662

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 151.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

            if energy_category_set is not None and len(energy_category_set) > 0:
                for energy_category_id in energy_category_set:
                    result['associated_equipment']['energy_category_names'].append(
                        energy_category_dict[energy_category_id]['name'])
                    result['associated_equipment']['units'].append('KG')
    Severity: Major
    Found in myems-api/reports/combinedequipmentcarbon.py and 1 other location - About 1 day to fix
    myems-api/reports/spacecarbon.py on lines 659..666

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 151.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function $get has 259 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        this.$get = ['$http', '$log', '$q', '$timeout', function($http, $log, $q, $timeout) {
    
          var noop = angular.noop,
              forEach = angular.forEach,
              extend = angular.extend,
    Severity: Major
    Found in myems-admin/js/angular/angular-resource.js - About 1 day to fix

      Function setOptions has 258 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              setOptions: function(options, callback) {
      
                  this.startDate = moment().startOf('day');
                  this.endDate = moment().endOf('day');
                  this.timeZone = moment().utcOffset();
      Severity: Major
      Found in myems-admin/js/plugins/daterangepicker/daterangepicker.js - About 1 day to fix

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

        export default [
          'Afghanistan',
          'Albania',
          'Algeria',
          'American Samoa',
        Severity: Major
        Found in myems-web/src/data/billing/countries.js and 1 other location - About 1 day to fix
        myems-web/src/components/auth/wizard/BillingUserForm.js on lines 54..294

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 241.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

                    options={[
                      'Afghanistan',
                      'Albania',
                      'Algeria',
                      'American Samoa',
        Severity: Major
        Found in myems-web/src/components/auth/wizard/BillingUserForm.js and 1 other location - About 1 day to fix
        myems-web/src/data/billing/countries.js on lines 1..241

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 241.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        File shopfloorstatistics.py has 592 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: Major
        Found in myems-api/reports/shopfloorstatistics.py - About 1 day to fix

          File sensor.py has 592 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import uuid
          from datetime import datetime, timedelta
          import falcon
          import mysql.connector
          import simplejson as json
          Severity: Major
          Found in myems-api/core/sensor.py - About 1 day to fix

            File spaceefficiency.py has 590 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import base64
            from core.utilities import get_translation
            import os
            import re
            import uuid
            Severity: Major
            Found in myems-api/excelexporters/spaceefficiency.py - About 1 day to fix

              File combinedequipmentstatistics.py has 589 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: Major
              Found in myems-api/reports/combinedequipmentstatistics.py - About 1 day to fix

                File spacestatistics.py has 588 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: Major
                Found in myems-api/reports/spacestatistics.py - About 1 day to fix

                  File tenantstatistics.py has 588 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: Major
                  Found in myems-api/reports/tenantstatistics.py - About 1 day to fix

                    File storestatistics.py has 588 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: Major
                    Found in myems-api/reports/storestatistics.py - About 1 day to fix

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                        const statusFormatter = status => {
                          let color = '';
                          let icon = '';
                          let text = '';
                          switch (status) {
                      Severity: Major
                      Found in myems-web/src/components/MyEMS/Microgrid/MicrogridTable.js and 1 other location - About 1 day to fix
                      myems-web/src/components/MyEMS/EnergyStoragePowerStation/EnergyStoragePowerStationTable.js on lines 104..140

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 237.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                        const statusFormatter = status => {
                          let color = '';
                          let icon = '';
                          let text = '';
                          switch (status) {
                      myems-web/src/components/MyEMS/Microgrid/MicrogridTable.js on lines 86..122

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 237.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      File metersaving.py has 584 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import base64
                      from core.utilities import get_translation
                      import os
                      import re
                      import uuid
                      Severity: Major
                      Found in myems-api/excelexporters/metersaving.py - About 1 day to fix
                        Severity
                        Category
                        Status
                        Source
                        Language