Showing 10,536 of 10,536 total issues

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

        if 'priority' not in new_values['data'].keys() or \
                not isinstance(new_values['data']['priority'], str) or \
                len(str.strip(new_values['data']['priority'])) == 0 or \
                str.strip(new_values['data']['priority']) not in \
                ('CRITICAL', 'HIGH', 'MEDIUM', 'LOW'):
Severity: Major
Found in myems-api/core/rule.py and 1 other location - About 1 day to fix
myems-api/core/rule.py on lines 115..120

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 124.

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_item_id is not None:
            cursor.execute(" SELECT name, energy_category_id "
                           " FROM tbl_energy_items "
                           " WHERE id = %s ",
                           (energy_item_id,))
Severity: Major
Found in myems-api/core/meter.py and 1 other location - About 1 day to fix
myems-api/core/meter.py on lines 1585..1600

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 124.

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 createHttpBackendMock has 204 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
  var definitions = [],
      expectations = [],
      matchLatestDefinition = false,
      responses = [],
Severity: Major
Found in myems-admin/js/angular/angular-mocks.js - About 1 day to fix

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

            this.container.find('.calendar')
                .on('click.daterangepicker', '.prev', $.proxy(this.clickPrev, this))
                .on('click.daterangepicker', '.next', $.proxy(this.clickNext, this))
                .on('click.daterangepicker', 'td.available', $.proxy(this.clickDate, this))
                .on('mouseenter.daterangepicker', 'td.available', $.proxy(this.hoverDate, this))
    Severity: Major
    Found in myems-admin/js/plugins/daterangepicker/daterangepicker.js and 1 other location - About 1 day to fix
    myems-admin/js/plugins/daterangepicker/daterangepicker.js on lines 86..94

    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 198.

    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

            this.container.find('.ranges')
                .on('click.daterangepicker', 'button.applyBtn', $.proxy(this.clickApply, this))
                .on('click.daterangepicker', 'button.cancelBtn', $.proxy(this.clickCancel, this))
                .on('click.daterangepicker', '.daterangepicker_start_input,.daterangepicker_end_input', $.proxy(this.showCalendars, this))
                .on('change.daterangepicker', '.daterangepicker_start_input,.daterangepicker_end_input', $.proxy(this.inputsChanged, this))
    Severity: Major
    Found in myems-admin/js/plugins/daterangepicker/daterangepicker.js and 1 other location - About 1 day to fix
    myems-admin/js/plugins/daterangepicker/daterangepicker.js on lines 76..84

    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 198.

    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 ClockPicker has 203 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function ClockPicker(element, options) {
            var popover = $(tpl),
                plate = popover.find('.clockpicker-plate'),
                hoursView = popover.find('.clockpicker-hours'),
                minutesView = popover.find('.clockpicker-minutes'),
    Severity: Major
    Found in myems-admin/js/plugins/clockpicker/clockpicker.js - About 1 day to fix

      File storeenergyitem.py has 505 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/storeenergyitem.py - About 1 day to fix

        File tenantenergyitem.py has 505 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/tenantenergyitem.py - About 1 day to fix

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

              $scope.changeMeterType = function() {
                  switch ($scope.currentMeterType.selected.sid) {
                      case 'meter':
                          $scope.currentmeters = $scope.meters;
                          break;
          myems-admin/app/controllers/settings/meter/virtualmeter.controller.js on lines 568..590

          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 197.

          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

              $scope.changeMeterType = function() {
                  switch ($scope.currentMeterType.selected.sid) {
                      case 'meter':
                          $scope.currentmeters = $scope.meters;
                          break;
          myems-admin/app/controllers/settings/meter/virtualmeter.controller.js on lines 437..459

          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 197.

          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 on_post has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
          Open

              def on_post(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/distributionsystem.py - About 1 day 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

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

                  if 'status' not in new_values['data'].keys() or \
                          not isinstance(new_values['data']['status'], str) or \
                          len(str.strip(new_values['data']['status'])) == 0 or \
                          str.strip(new_values['data']['status']) not in ('new', 'acknowledged', 'timeout'):
                      raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
          Severity: Major
          Found in myems-api/core/user.py and 6 other locations - About 1 day to fix
          myems-api/core/emailmessage.py on lines 356..360
          myems-api/core/notification.py on lines 274..278
          myems-api/core/textmessage.py on lines 327..331
          myems-api/core/webmessage.py on lines 300..304
          myems-api/core/webmessage.py on lines 526..530
          myems-api/core/wechatmessage.py on lines 375..379

          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 123.

          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 7 locations. Consider refactoring.
          Open

                  if 'status' not in new_values['data'].keys() or \
                          not isinstance(new_values['data']['status'], str) or \
                          len(str.strip(new_values['data']['status'])) == 0 or \
                          str.strip(new_values['data']['status']) not in ('new', 'acknowledged', 'timeout'):
                      raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
          Severity: Major
          Found in myems-api/core/wechatmessage.py and 6 other locations - About 1 day to fix
          myems-api/core/emailmessage.py on lines 356..360
          myems-api/core/notification.py on lines 274..278
          myems-api/core/textmessage.py on lines 327..331
          myems-api/core/user.py on lines 1434..1438
          myems-api/core/webmessage.py on lines 300..304
          myems-api/core/webmessage.py on lines 526..530

          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 123.

          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 7 locations. Consider refactoring.
          Open

                  if 'status' not in new_values['data'].keys() or \
                          not isinstance(new_values['data']['status'], str) or \
                          len(str.strip(new_values['data']['status'])) == 0 or \
                          str.strip(new_values['data']['status']) not in ('new', 'acknowledged', 'read'):
                      raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
          Severity: Major
          Found in myems-api/core/webmessage.py and 6 other locations - About 1 day to fix
          myems-api/core/emailmessage.py on lines 356..360
          myems-api/core/notification.py on lines 274..278
          myems-api/core/textmessage.py on lines 327..331
          myems-api/core/user.py on lines 1434..1438
          myems-api/core/webmessage.py on lines 300..304
          myems-api/core/wechatmessage.py on lines 375..379

          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 123.

          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 7 locations. Consider refactoring.
          Open

                  if 'status' not in new_values['data'].keys() or \
                          not isinstance(new_values['data']['status'], str) or \
                          len(str.strip(new_values['data']['status'])) == 0 or \
                          str.strip(new_values['data']['status']) not in ('new', 'acknowledged', 'timeout'):
                      raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
          Severity: Major
          Found in myems-api/core/emailmessage.py and 6 other locations - About 1 day to fix
          myems-api/core/notification.py on lines 274..278
          myems-api/core/textmessage.py on lines 327..331
          myems-api/core/user.py on lines 1434..1438
          myems-api/core/webmessage.py on lines 300..304
          myems-api/core/webmessage.py on lines 526..530
          myems-api/core/wechatmessage.py on lines 375..379

          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 123.

          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 7 locations. Consider refactoring.
          Open

                  if 'status' not in new_values['data'].keys() or \
                          not isinstance(new_values['data']['status'], str) or \
                          len(str.strip(new_values['data']['status'])) == 0 or \
                          str.strip(new_values['data']['status']) not in ('new', 'acknowledged', 'timeout'):
                      raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
          Severity: Major
          Found in myems-api/core/textmessage.py and 6 other locations - About 1 day to fix
          myems-api/core/emailmessage.py on lines 356..360
          myems-api/core/notification.py on lines 274..278
          myems-api/core/user.py on lines 1434..1438
          myems-api/core/webmessage.py on lines 300..304
          myems-api/core/webmessage.py on lines 526..530
          myems-api/core/wechatmessage.py on lines 375..379

          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 123.

          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 is_online:
                              query = (" SELECT tescb.soc_point_id, tescb.power_point_id "
                                       " FROM tbl_energy_storage_power_stations_containers tespsc, "
                                       "      tbl_energy_storage_containers_batteries tescb "
                                       " WHERE tespsc.energy_storage_power_station_id = %s "
          Severity: Major
          Found in myems-api/reports/energystoragepowerstationlist.py and 1 other location - About 1 day to fix
          myems-api/reports/microgridlist.py on lines 187..197

          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 123.

          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 3 locations. Consider refactoring.
          Open

                      for j in range(0, time_len):
                          row = str(start_detail_data_row_num + 1 + j)
                          # col = chr(ord('B') + i)
                          ws[col + row].font = title_font
                          ws[col + row].alignment = c_c_alignment
          Severity: Major
          Found in myems-api/excelexporters/metercomparison.py and 2 other locations - About 1 day to fix
          myems-api/excelexporters/metercomparison.py on lines 321..327
          myems-api/excelexporters/metercomparison.py on lines 342..348

          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 123.

          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 7 locations. Consider refactoring.
          Open

                  if 'status' not in new_values['data'].keys() or \
                          not isinstance(new_values['data']['status'], str) or \
                          len(str.strip(new_values['data']['status'])) == 0 or \
                          str.strip(new_values['data']['status']) not in ('unread', 'read', 'archived'):
                      raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
          Severity: Major
          Found in myems-api/core/notification.py and 6 other locations - About 1 day to fix
          myems-api/core/emailmessage.py on lines 356..360
          myems-api/core/textmessage.py on lines 327..331
          myems-api/core/user.py on lines 1434..1438
          myems-api/core/webmessage.py on lines 300..304
          myems-api/core/webmessage.py on lines 526..530
          myems-api/core/wechatmessage.py on lines 375..379

          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 123.

          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 3 locations. Consider refactoring.
          Open

                      for j in range(0, time_len):
                          row = str(start_detail_data_row_num + 1 + j)
                          # col = chr(ord('B') + i)
                          ws[col + row].font = title_font
                          ws[col + row].alignment = c_c_alignment
          Severity: Major
          Found in myems-api/excelexporters/metercomparison.py and 2 other locations - About 1 day to fix
          myems-api/excelexporters/metercomparison.py on lines 299..305
          myems-api/excelexporters/metercomparison.py on lines 321..327

          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 123.

          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

          Severity
          Category
          Status
          Source
          Language