Showing 10,536 of 10,536 total issues

Function main has a Cognitive Complexity of 152 (exceeds 5 allowed). Consider refactoring.
Open

def main(logger):

    while True:
        # the outermost while loop
        ################################################################################################################
Severity: Minor
Found in myems-aggregation/space_billing_input_item.py - About 3 days 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 main has a Cognitive Complexity of 152 (exceeds 5 allowed). Consider refactoring.
Open

def main(logger):

    while True:
        # the outermost while loop
        ################################################################################################################
Severity: Minor
Found in myems-aggregation/space_billing_input_category.py - About 3 days 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 main has a Cognitive Complexity of 152 (exceeds 5 allowed). Consider refactoring.
Open

def main(logger):

    while True:
        # the outermost while loop
        ################################################################################################################
Severity: Minor
Found in myems-aggregation/combined_equipment_billing_input_item.py - About 3 days 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 main has a Cognitive Complexity of 152 (exceeds 5 allowed). Consider refactoring.
Open

def main(logger):

    while True:
        # the outermost while loop
        ################################################################################################################
Severity: Minor
Found in myems-aggregation/tenant_billing_input_category.py - About 3 days 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 main has a Cognitive Complexity of 152 (exceeds 5 allowed). Consider refactoring.
Open

def main(logger):

    while True:
        # the outermost while loop
        ################################################################################################################
Severity: Minor
Found in myems-aggregation/equipment_carbon_input_category.py - About 3 days 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

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

    fetch(APIBaseURL + '/webmessages/' + id, {
      method: 'DELETE',
      headers: {
        'Content-type': 'application/json',
        'User-UUID': getCookieValue('user_uuid'),
Severity: Major
Found in myems-web/src/components/MyEMS/Notification/Notification.js and 2 other locations - About 3 days to fix
myems-web/src/components/MyEMS/Notification/Notification.js on lines 405..492
myems-web/src/components/MyEMS/Notification/Notification.js on lines 501..589

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

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

    fetch(APIBaseURL + '/webmessages/' + id, {
      method: 'PUT',
      headers: {
        'Content-type': 'application/json',
        'User-UUID': getCookieValue('user_uuid'),
Severity: Major
Found in myems-web/src/components/MyEMS/Notification/Notification.js and 2 other locations - About 3 days to fix
myems-web/src/components/MyEMS/Notification/Notification.js on lines 501..589
myems-web/src/components/MyEMS/Notification/Notification.js on lines 598..681

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

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

    fetch(APIBaseURL + '/webmessages/' + id, {
      method: 'PUT',
      headers: {
        'Content-type': 'application/json',
        'User-UUID': getCookieValue('user_uuid'),
Severity: Major
Found in myems-web/src/components/MyEMS/Notification/Notification.js and 2 other locations - About 3 days to fix
myems-web/src/components/MyEMS/Notification/Notification.js on lines 405..492
myems-web/src/components/MyEMS/Notification/Notification.js on lines 598..681

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

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

def process(logger):

    while True:
        # the outermost loop to reconnect server if there is a connection error
        cnx_historical = None
Severity: Minor
Found in myems-cleaning/clean_energy_value.py - About 3 days 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 generate_excel has a Cognitive Complexity of 151 (exceeds 5 allowed). Consider refactoring.
Open

def generate_excel(report,
                   name,
                   base_period_start_datetime_local,
                   base_period_end_datetime_local,
                   reporting_start_datetime_local,
Severity: Minor
Found in myems-api/excelexporters/equipmentstatistics.py - About 3 days 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 149 (exceeds 5 allowed). Consider refactoring.
Open

    def on_get(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/space.py - About 3 days 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 averaging_hourly_data_by_period has a Cognitive Complexity of 148 (exceeds 5 allowed). Consider refactoring.
Open

def averaging_hourly_data_by_period(rows_hourly, start_datetime_utc, end_datetime_utc, period_type):
    # todo: validate parameters
    if start_datetime_utc is None or \
            end_datetime_utc is None or \
            start_datetime_utc >= end_datetime_utc or \
Severity: Minor
Found in myems-api/core/utilities.py - About 3 days 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

File activeUsers.js has 1165 lines of code (exceeds 250 allowed). Consider refactoring.
Open

export const activeUserHistory = [
  183,
  163,
  176,
  172,
Severity: Major
Found in myems-web/src/data/dashboard/activeUsers.js - About 2 days to fix

    Function generate_excel has a Cognitive Complexity of 146 (exceeds 5 allowed). Consider refactoring.
    Open

    def generate_excel(report,
                       name,
                       base_period_start_datetime_local,
                       base_period_end_datetime_local,
                       reporting_start_datetime_local,
    Severity: Minor
    Found in myems-api/excelexporters/spaceenergyitem.py - About 2 days 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 30 locations. Consider refactoring.
    Open

    angular.module("ngLocale", [], ["$provide", function($provide) {
    var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
    $provide.value("$locale", {
      "DATETIME_FORMATS": {
        "AMPMS": [
    Severity: Major
    Found in myems-admin/js/angular/i18n/angular-locale_ar-tn.js and 29 other locations - About 2 days to fix
    myems-admin/js/angular/i18n/angular-locale_ar-001.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ae.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-bh.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-dj.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-dz.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-eg.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-eh.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-er.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-il.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-iq.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-jo.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-km.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-kw.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-lb.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ly.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ma.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-mr.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-om.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ps.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-qa.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-sa.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-sd.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-so.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ss.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-sy.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-td.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-xb.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ye.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar.js on lines 2..125

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

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

    angular.module("ngLocale", [], ["$provide", function($provide) {
    var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
    $provide.value("$locale", {
      "DATETIME_FORMATS": {
        "AMPMS": [
    Severity: Major
    Found in myems-admin/js/angular/i18n/angular-locale_ar-ye.js and 29 other locations - About 2 days to fix
    myems-admin/js/angular/i18n/angular-locale_ar-001.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ae.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-bh.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-dj.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-dz.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-eg.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-eh.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-er.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-il.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-iq.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-jo.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-km.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-kw.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-lb.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ly.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ma.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-mr.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-om.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ps.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-qa.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-sa.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-sd.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-so.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ss.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-sy.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-td.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-tn.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-xb.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar.js on lines 2..125

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

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

    angular.module("ngLocale", [], ["$provide", function($provide) {
    var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
    $provide.value("$locale", {
      "DATETIME_FORMATS": {
        "AMPMS": [
    Severity: Major
    Found in myems-admin/js/angular/i18n/angular-locale_ar-km.js and 29 other locations - About 2 days to fix
    myems-admin/js/angular/i18n/angular-locale_ar-001.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ae.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-bh.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-dj.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-dz.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-eg.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-eh.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-er.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-il.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-iq.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-jo.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-kw.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-lb.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ly.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ma.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-mr.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-om.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ps.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-qa.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-sa.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-sd.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-so.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ss.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-sy.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-td.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-tn.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-xb.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ye.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar.js on lines 2..125

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

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

    angular.module("ngLocale", [], ["$provide", function($provide) {
    var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
    $provide.value("$locale", {
      "DATETIME_FORMATS": {
        "AMPMS": [
    Severity: Major
    Found in myems-admin/js/angular/i18n/angular-locale_ar.js and 29 other locations - About 2 days to fix
    myems-admin/js/angular/i18n/angular-locale_ar-001.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ae.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-bh.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-dj.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-dz.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-eg.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-eh.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-er.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-il.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-iq.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-jo.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-km.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-kw.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-lb.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ly.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ma.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-mr.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-om.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ps.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-qa.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-sa.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-sd.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-so.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ss.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-sy.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-td.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-tn.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-xb.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ye.js on lines 2..125

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

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

    angular.module("ngLocale", [], ["$provide", function($provide) {
    var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
    $provide.value("$locale", {
      "DATETIME_FORMATS": {
        "AMPMS": [
    Severity: Major
    Found in myems-admin/js/angular/i18n/angular-locale_ar-il.js and 29 other locations - About 2 days to fix
    myems-admin/js/angular/i18n/angular-locale_ar-001.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ae.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-bh.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-dj.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-dz.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-eg.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-eh.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-er.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-iq.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-jo.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-km.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-kw.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-lb.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ly.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ma.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-mr.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-om.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ps.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-qa.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-sa.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-sd.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-so.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ss.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-sy.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-td.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-tn.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-xb.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ye.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar.js on lines 2..125

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

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

    angular.module("ngLocale", [], ["$provide", function($provide) {
    var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
    $provide.value("$locale", {
      "DATETIME_FORMATS": {
        "AMPMS": [
    Severity: Major
    Found in myems-admin/js/angular/i18n/angular-locale_ar-er.js and 29 other locations - About 2 days to fix
    myems-admin/js/angular/i18n/angular-locale_ar-001.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ae.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-bh.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-dj.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-dz.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-eg.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-eh.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-il.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-iq.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-jo.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-km.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-kw.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-lb.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ly.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ma.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-mr.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-om.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ps.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-qa.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-sa.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-sd.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-so.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ss.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-sy.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-td.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-tn.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-xb.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar-ye.js on lines 2..125
    myems-admin/js/angular/i18n/angular-locale_ar.js on lines 2..125

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

    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