GladysProject/Gladys

View on GitHub
server/services/zigbee2mqtt/exposes/numericType.js

Summary

Maintainability
F
5 days
Test Coverage

File numericType.js has 788 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const { DEVICE_FEATURE_CATEGORIES, DEVICE_FEATURE_TYPES, DEVICE_FEATURE_UNITS } = require('../../../utils/constants');

module.exports = {
  type: 'numeric',
  writeValue: (expose, value) => {
Severity: Major
Found in server/services/zigbee2mqtt/exposes/numericType.js - About 1 day to fix

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

        local_temperature: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.TEMPERATURE_SENSOR,
            type: DEVICE_FEATURE_TYPES.SENSOR.DECIMAL,
            unit: DEVICE_FEATURE_UNITS.CELSIUS,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 6 other locations - About 1 hr to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 105..113
    server/services/zigbee2mqtt/exposes/numericType.js on lines 114..122
    server/services/zigbee2mqtt/exposes/numericType.js on lines 226..234
    server/services/zigbee2mqtt/exposes/numericType.js on lines 764..772
    server/services/zigbee2mqtt/exposes/numericType.js on lines 773..781
    server/services/zigbee2mqtt/exposes/numericType.js on lines 782..790

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

    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

        angle_x: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.VIBRATION_SENSOR,
            type: DEVICE_FEATURE_TYPES.VIBRATION_SENSOR.ANGLE_X,
            unit: DEVICE_FEATURE_UNITS.DEGREE,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 6 other locations - About 1 hr to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 105..113
    server/services/zigbee2mqtt/exposes/numericType.js on lines 114..122
    server/services/zigbee2mqtt/exposes/numericType.js on lines 169..177
    server/services/zigbee2mqtt/exposes/numericType.js on lines 226..234
    server/services/zigbee2mqtt/exposes/numericType.js on lines 773..781
    server/services/zigbee2mqtt/exposes/numericType.js on lines 782..790

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

    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

        temperature: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.TEMPERATURE_SENSOR,
            type: DEVICE_FEATURE_TYPES.SENSOR.DECIMAL,
            unit: DEVICE_FEATURE_UNITS.CELSIUS,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 6 other locations - About 1 hr to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 105..113
    server/services/zigbee2mqtt/exposes/numericType.js on lines 114..122
    server/services/zigbee2mqtt/exposes/numericType.js on lines 169..177
    server/services/zigbee2mqtt/exposes/numericType.js on lines 764..772
    server/services/zigbee2mqtt/exposes/numericType.js on lines 773..781
    server/services/zigbee2mqtt/exposes/numericType.js on lines 782..790

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

    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

        angle_z: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.VIBRATION_SENSOR,
            type: DEVICE_FEATURE_TYPES.VIBRATION_SENSOR.ANGLE_Z,
            unit: DEVICE_FEATURE_UNITS.DEGREE,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 6 other locations - About 1 hr to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 105..113
    server/services/zigbee2mqtt/exposes/numericType.js on lines 114..122
    server/services/zigbee2mqtt/exposes/numericType.js on lines 169..177
    server/services/zigbee2mqtt/exposes/numericType.js on lines 226..234
    server/services/zigbee2mqtt/exposes/numericType.js on lines 764..772
    server/services/zigbee2mqtt/exposes/numericType.js on lines 773..781

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

    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

        device_temperature: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.DEVICE_TEMPERATURE_SENSOR,
            type: DEVICE_FEATURE_TYPES.SENSOR.DECIMAL,
            unit: DEVICE_FEATURE_UNITS.CELSIUS,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 6 other locations - About 1 hr to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 105..113
    server/services/zigbee2mqtt/exposes/numericType.js on lines 169..177
    server/services/zigbee2mqtt/exposes/numericType.js on lines 226..234
    server/services/zigbee2mqtt/exposes/numericType.js on lines 764..772
    server/services/zigbee2mqtt/exposes/numericType.js on lines 773..781
    server/services/zigbee2mqtt/exposes/numericType.js on lines 782..790

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

    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

        angle_y: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.VIBRATION_SENSOR,
            type: DEVICE_FEATURE_TYPES.VIBRATION_SENSOR.ANGLE_Y,
            unit: DEVICE_FEATURE_UNITS.DEGREE,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 6 other locations - About 1 hr to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 105..113
    server/services/zigbee2mqtt/exposes/numericType.js on lines 114..122
    server/services/zigbee2mqtt/exposes/numericType.js on lines 169..177
    server/services/zigbee2mqtt/exposes/numericType.js on lines 226..234
    server/services/zigbee2mqtt/exposes/numericType.js on lines 764..772
    server/services/zigbee2mqtt/exposes/numericType.js on lines 782..790

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

    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

        cpu_temperature: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.DEVICE_TEMPERATURE_SENSOR,
            type: DEVICE_FEATURE_TYPES.SENSOR.DECIMAL,
            unit: DEVICE_FEATURE_UNITS.CELSIUS,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 6 other locations - About 1 hr to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 114..122
    server/services/zigbee2mqtt/exposes/numericType.js on lines 169..177
    server/services/zigbee2mqtt/exposes/numericType.js on lines 226..234
    server/services/zigbee2mqtt/exposes/numericType.js on lines 764..772
    server/services/zigbee2mqtt/exposes/numericType.js on lines 773..781
    server/services/zigbee2mqtt/exposes/numericType.js on lines 782..790

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

    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

        voc: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.VOC_SENSOR,
            type: DEVICE_FEATURE_TYPES.VOC_SENSOR.DECIMAL,
            unit: DEVICE_FEATURE_UNITS.PPB,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 1 other location - About 1 hr to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 273..281

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

    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

        BASE: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.ENERGY_SENSOR,
            type: DEVICE_FEATURE_TYPES.ENERGY_SENSOR.INDEX,
            unit: DEVICE_FEATURE_UNITS.KILOWATT_HOUR,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 1 other location - About 1 hr to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 720..728

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

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

        formaldehyd: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.FORMALDEHYD_SENSOR,
            type: DEVICE_FEATURE_TYPES.SENSOR.DECIMAL,
            unit: DEVICE_FEATURE_UNITS.MICROGRAM_PER_CUBIC_METER,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 24 other locations - About 55 mins to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 27..35
    server/services/zigbee2mqtt/exposes/numericType.js on lines 36..44
    server/services/zigbee2mqtt/exposes/numericType.js on lines 70..78
    server/services/zigbee2mqtt/exposes/numericType.js on lines 87..95
    server/services/zigbee2mqtt/exposes/numericType.js on lines 96..104
    server/services/zigbee2mqtt/exposes/numericType.js on lines 143..151
    server/services/zigbee2mqtt/exposes/numericType.js on lines 152..160
    server/services/zigbee2mqtt/exposes/numericType.js on lines 282..290
    server/services/zigbee2mqtt/exposes/numericType.js on lines 291..299
    server/services/zigbee2mqtt/exposes/numericType.js on lines 300..308
    server/services/zigbee2mqtt/exposes/numericType.js on lines 309..317
    server/services/zigbee2mqtt/exposes/numericType.js on lines 318..326
    server/services/zigbee2mqtt/exposes/numericType.js on lines 327..335
    server/services/zigbee2mqtt/exposes/numericType.js on lines 336..344
    server/services/zigbee2mqtt/exposes/numericType.js on lines 345..353
    server/services/zigbee2mqtt/exposes/numericType.js on lines 354..362
    server/services/zigbee2mqtt/exposes/numericType.js on lines 363..371
    server/services/zigbee2mqtt/exposes/numericType.js on lines 372..380
    server/services/zigbee2mqtt/exposes/numericType.js on lines 500..508
    server/services/zigbee2mqtt/exposes/numericType.js on lines 509..517
    server/services/zigbee2mqtt/exposes/numericType.js on lines 518..526
    server/services/zigbee2mqtt/exposes/numericType.js on lines 527..535
    server/services/zigbee2mqtt/exposes/numericType.js on lines 737..745
    server/services/zigbee2mqtt/exposes/numericType.js on lines 746..754

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

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

        EASD03: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.ENERGY_SENSOR,
            type: DEVICE_FEATURE_TYPES.ENERGY_SENSOR.INDEX,
            unit: DEVICE_FEATURE_UNITS.KILOWATT_HOUR,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 24 other locations - About 55 mins to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 27..35
    server/services/zigbee2mqtt/exposes/numericType.js on lines 36..44
    server/services/zigbee2mqtt/exposes/numericType.js on lines 70..78
    server/services/zigbee2mqtt/exposes/numericType.js on lines 87..95
    server/services/zigbee2mqtt/exposes/numericType.js on lines 96..104
    server/services/zigbee2mqtt/exposes/numericType.js on lines 143..151
    server/services/zigbee2mqtt/exposes/numericType.js on lines 152..160
    server/services/zigbee2mqtt/exposes/numericType.js on lines 282..290
    server/services/zigbee2mqtt/exposes/numericType.js on lines 291..299
    server/services/zigbee2mqtt/exposes/numericType.js on lines 300..308
    server/services/zigbee2mqtt/exposes/numericType.js on lines 309..317
    server/services/zigbee2mqtt/exposes/numericType.js on lines 318..326
    server/services/zigbee2mqtt/exposes/numericType.js on lines 327..335
    server/services/zigbee2mqtt/exposes/numericType.js on lines 336..344
    server/services/zigbee2mqtt/exposes/numericType.js on lines 345..353
    server/services/zigbee2mqtt/exposes/numericType.js on lines 354..362
    server/services/zigbee2mqtt/exposes/numericType.js on lines 363..371
    server/services/zigbee2mqtt/exposes/numericType.js on lines 372..380
    server/services/zigbee2mqtt/exposes/numericType.js on lines 500..508
    server/services/zigbee2mqtt/exposes/numericType.js on lines 509..517
    server/services/zigbee2mqtt/exposes/numericType.js on lines 527..535
    server/services/zigbee2mqtt/exposes/numericType.js on lines 737..745
    server/services/zigbee2mqtt/exposes/numericType.js on lines 746..754
    server/services/zigbee2mqtt/exposes/numericType.js on lines 755..763

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

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

        battpercentage: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.BATTERY,
            type: DEVICE_FEATURE_TYPES.SENSOR.INTEGER,
            unit: DEVICE_FEATURE_UNITS.PERCENT,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 24 other locations - About 55 mins to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 27..35
    server/services/zigbee2mqtt/exposes/numericType.js on lines 70..78
    server/services/zigbee2mqtt/exposes/numericType.js on lines 87..95
    server/services/zigbee2mqtt/exposes/numericType.js on lines 96..104
    server/services/zigbee2mqtt/exposes/numericType.js on lines 143..151
    server/services/zigbee2mqtt/exposes/numericType.js on lines 152..160
    server/services/zigbee2mqtt/exposes/numericType.js on lines 282..290
    server/services/zigbee2mqtt/exposes/numericType.js on lines 291..299
    server/services/zigbee2mqtt/exposes/numericType.js on lines 300..308
    server/services/zigbee2mqtt/exposes/numericType.js on lines 309..317
    server/services/zigbee2mqtt/exposes/numericType.js on lines 318..326
    server/services/zigbee2mqtt/exposes/numericType.js on lines 327..335
    server/services/zigbee2mqtt/exposes/numericType.js on lines 336..344
    server/services/zigbee2mqtt/exposes/numericType.js on lines 345..353
    server/services/zigbee2mqtt/exposes/numericType.js on lines 354..362
    server/services/zigbee2mqtt/exposes/numericType.js on lines 363..371
    server/services/zigbee2mqtt/exposes/numericType.js on lines 372..380
    server/services/zigbee2mqtt/exposes/numericType.js on lines 500..508
    server/services/zigbee2mqtt/exposes/numericType.js on lines 509..517
    server/services/zigbee2mqtt/exposes/numericType.js on lines 518..526
    server/services/zigbee2mqtt/exposes/numericType.js on lines 527..535
    server/services/zigbee2mqtt/exposes/numericType.js on lines 737..745
    server/services/zigbee2mqtt/exposes/numericType.js on lines 746..754
    server/services/zigbee2mqtt/exposes/numericType.js on lines 755..763

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

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

        EASF10: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.ENERGY_SENSOR,
            type: DEVICE_FEATURE_TYPES.ENERGY_SENSOR.INDEX,
            unit: DEVICE_FEATURE_UNITS.KILOWATT_HOUR,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 24 other locations - About 55 mins to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 27..35
    server/services/zigbee2mqtt/exposes/numericType.js on lines 36..44
    server/services/zigbee2mqtt/exposes/numericType.js on lines 70..78
    server/services/zigbee2mqtt/exposes/numericType.js on lines 87..95
    server/services/zigbee2mqtt/exposes/numericType.js on lines 96..104
    server/services/zigbee2mqtt/exposes/numericType.js on lines 143..151
    server/services/zigbee2mqtt/exposes/numericType.js on lines 152..160
    server/services/zigbee2mqtt/exposes/numericType.js on lines 282..290
    server/services/zigbee2mqtt/exposes/numericType.js on lines 291..299
    server/services/zigbee2mqtt/exposes/numericType.js on lines 300..308
    server/services/zigbee2mqtt/exposes/numericType.js on lines 309..317
    server/services/zigbee2mqtt/exposes/numericType.js on lines 318..326
    server/services/zigbee2mqtt/exposes/numericType.js on lines 327..335
    server/services/zigbee2mqtt/exposes/numericType.js on lines 336..344
    server/services/zigbee2mqtt/exposes/numericType.js on lines 345..353
    server/services/zigbee2mqtt/exposes/numericType.js on lines 354..362
    server/services/zigbee2mqtt/exposes/numericType.js on lines 363..371
    server/services/zigbee2mqtt/exposes/numericType.js on lines 500..508
    server/services/zigbee2mqtt/exposes/numericType.js on lines 509..517
    server/services/zigbee2mqtt/exposes/numericType.js on lines 518..526
    server/services/zigbee2mqtt/exposes/numericType.js on lines 527..535
    server/services/zigbee2mqtt/exposes/numericType.js on lines 737..745
    server/services/zigbee2mqtt/exposes/numericType.js on lines 746..754
    server/services/zigbee2mqtt/exposes/numericType.js on lines 755..763

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

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

        EASD02: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.ENERGY_SENSOR,
            type: DEVICE_FEATURE_TYPES.ENERGY_SENSOR.INDEX,
            unit: DEVICE_FEATURE_UNITS.KILOWATT_HOUR,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 24 other locations - About 55 mins to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 27..35
    server/services/zigbee2mqtt/exposes/numericType.js on lines 36..44
    server/services/zigbee2mqtt/exposes/numericType.js on lines 70..78
    server/services/zigbee2mqtt/exposes/numericType.js on lines 87..95
    server/services/zigbee2mqtt/exposes/numericType.js on lines 96..104
    server/services/zigbee2mqtt/exposes/numericType.js on lines 143..151
    server/services/zigbee2mqtt/exposes/numericType.js on lines 152..160
    server/services/zigbee2mqtt/exposes/numericType.js on lines 282..290
    server/services/zigbee2mqtt/exposes/numericType.js on lines 291..299
    server/services/zigbee2mqtt/exposes/numericType.js on lines 300..308
    server/services/zigbee2mqtt/exposes/numericType.js on lines 309..317
    server/services/zigbee2mqtt/exposes/numericType.js on lines 318..326
    server/services/zigbee2mqtt/exposes/numericType.js on lines 327..335
    server/services/zigbee2mqtt/exposes/numericType.js on lines 336..344
    server/services/zigbee2mqtt/exposes/numericType.js on lines 345..353
    server/services/zigbee2mqtt/exposes/numericType.js on lines 354..362
    server/services/zigbee2mqtt/exposes/numericType.js on lines 363..371
    server/services/zigbee2mqtt/exposes/numericType.js on lines 372..380
    server/services/zigbee2mqtt/exposes/numericType.js on lines 500..508
    server/services/zigbee2mqtt/exposes/numericType.js on lines 518..526
    server/services/zigbee2mqtt/exposes/numericType.js on lines 527..535
    server/services/zigbee2mqtt/exposes/numericType.js on lines 737..745
    server/services/zigbee2mqtt/exposes/numericType.js on lines 746..754
    server/services/zigbee2mqtt/exposes/numericType.js on lines 755..763

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

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

        EASD04: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.ENERGY_SENSOR,
            type: DEVICE_FEATURE_TYPES.ENERGY_SENSOR.INDEX,
            unit: DEVICE_FEATURE_UNITS.KILOWATT_HOUR,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 24 other locations - About 55 mins to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 27..35
    server/services/zigbee2mqtt/exposes/numericType.js on lines 36..44
    server/services/zigbee2mqtt/exposes/numericType.js on lines 70..78
    server/services/zigbee2mqtt/exposes/numericType.js on lines 87..95
    server/services/zigbee2mqtt/exposes/numericType.js on lines 96..104
    server/services/zigbee2mqtt/exposes/numericType.js on lines 143..151
    server/services/zigbee2mqtt/exposes/numericType.js on lines 152..160
    server/services/zigbee2mqtt/exposes/numericType.js on lines 282..290
    server/services/zigbee2mqtt/exposes/numericType.js on lines 291..299
    server/services/zigbee2mqtt/exposes/numericType.js on lines 300..308
    server/services/zigbee2mqtt/exposes/numericType.js on lines 309..317
    server/services/zigbee2mqtt/exposes/numericType.js on lines 318..326
    server/services/zigbee2mqtt/exposes/numericType.js on lines 327..335
    server/services/zigbee2mqtt/exposes/numericType.js on lines 336..344
    server/services/zigbee2mqtt/exposes/numericType.js on lines 345..353
    server/services/zigbee2mqtt/exposes/numericType.js on lines 354..362
    server/services/zigbee2mqtt/exposes/numericType.js on lines 363..371
    server/services/zigbee2mqtt/exposes/numericType.js on lines 372..380
    server/services/zigbee2mqtt/exposes/numericType.js on lines 500..508
    server/services/zigbee2mqtt/exposes/numericType.js on lines 509..517
    server/services/zigbee2mqtt/exposes/numericType.js on lines 518..526
    server/services/zigbee2mqtt/exposes/numericType.js on lines 737..745
    server/services/zigbee2mqtt/exposes/numericType.js on lines 746..754
    server/services/zigbee2mqtt/exposes/numericType.js on lines 755..763

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

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

        current_phase_b: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.SWITCH,
            type: DEVICE_FEATURE_TYPES.SWITCH.CURRENT,
            unit: DEVICE_FEATURE_UNITS.AMPERE,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 24 other locations - About 55 mins to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 27..35
    server/services/zigbee2mqtt/exposes/numericType.js on lines 36..44
    server/services/zigbee2mqtt/exposes/numericType.js on lines 70..78
    server/services/zigbee2mqtt/exposes/numericType.js on lines 96..104
    server/services/zigbee2mqtt/exposes/numericType.js on lines 143..151
    server/services/zigbee2mqtt/exposes/numericType.js on lines 152..160
    server/services/zigbee2mqtt/exposes/numericType.js on lines 282..290
    server/services/zigbee2mqtt/exposes/numericType.js on lines 291..299
    server/services/zigbee2mqtt/exposes/numericType.js on lines 300..308
    server/services/zigbee2mqtt/exposes/numericType.js on lines 309..317
    server/services/zigbee2mqtt/exposes/numericType.js on lines 318..326
    server/services/zigbee2mqtt/exposes/numericType.js on lines 327..335
    server/services/zigbee2mqtt/exposes/numericType.js on lines 336..344
    server/services/zigbee2mqtt/exposes/numericType.js on lines 345..353
    server/services/zigbee2mqtt/exposes/numericType.js on lines 354..362
    server/services/zigbee2mqtt/exposes/numericType.js on lines 363..371
    server/services/zigbee2mqtt/exposes/numericType.js on lines 372..380
    server/services/zigbee2mqtt/exposes/numericType.js on lines 500..508
    server/services/zigbee2mqtt/exposes/numericType.js on lines 509..517
    server/services/zigbee2mqtt/exposes/numericType.js on lines 518..526
    server/services/zigbee2mqtt/exposes/numericType.js on lines 527..535
    server/services/zigbee2mqtt/exposes/numericType.js on lines 737..745
    server/services/zigbee2mqtt/exposes/numericType.js on lines 746..754
    server/services/zigbee2mqtt/exposes/numericType.js on lines 755..763

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

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

        BBRHPJR: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.ENERGY_SENSOR,
            type: DEVICE_FEATURE_TYPES.ENERGY_SENSOR.INDEX,
            unit: DEVICE_FEATURE_UNITS.KILOWATT_HOUR,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 24 other locations - About 55 mins to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 27..35
    server/services/zigbee2mqtt/exposes/numericType.js on lines 36..44
    server/services/zigbee2mqtt/exposes/numericType.js on lines 70..78
    server/services/zigbee2mqtt/exposes/numericType.js on lines 87..95
    server/services/zigbee2mqtt/exposes/numericType.js on lines 96..104
    server/services/zigbee2mqtt/exposes/numericType.js on lines 143..151
    server/services/zigbee2mqtt/exposes/numericType.js on lines 152..160
    server/services/zigbee2mqtt/exposes/numericType.js on lines 282..290
    server/services/zigbee2mqtt/exposes/numericType.js on lines 291..299
    server/services/zigbee2mqtt/exposes/numericType.js on lines 300..308
    server/services/zigbee2mqtt/exposes/numericType.js on lines 309..317
    server/services/zigbee2mqtt/exposes/numericType.js on lines 318..326
    server/services/zigbee2mqtt/exposes/numericType.js on lines 327..335
    server/services/zigbee2mqtt/exposes/numericType.js on lines 345..353
    server/services/zigbee2mqtt/exposes/numericType.js on lines 354..362
    server/services/zigbee2mqtt/exposes/numericType.js on lines 363..371
    server/services/zigbee2mqtt/exposes/numericType.js on lines 372..380
    server/services/zigbee2mqtt/exposes/numericType.js on lines 500..508
    server/services/zigbee2mqtt/exposes/numericType.js on lines 509..517
    server/services/zigbee2mqtt/exposes/numericType.js on lines 518..526
    server/services/zigbee2mqtt/exposes/numericType.js on lines 527..535
    server/services/zigbee2mqtt/exposes/numericType.js on lines 737..745
    server/services/zigbee2mqtt/exposes/numericType.js on lines 746..754
    server/services/zigbee2mqtt/exposes/numericType.js on lines 755..763

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

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

        battery: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.BATTERY,
            type: DEVICE_FEATURE_TYPES.SENSOR.INTEGER,
            unit: DEVICE_FEATURE_UNITS.PERCENT,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 24 other locations - About 55 mins to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 36..44
    server/services/zigbee2mqtt/exposes/numericType.js on lines 70..78
    server/services/zigbee2mqtt/exposes/numericType.js on lines 87..95
    server/services/zigbee2mqtt/exposes/numericType.js on lines 96..104
    server/services/zigbee2mqtt/exposes/numericType.js on lines 143..151
    server/services/zigbee2mqtt/exposes/numericType.js on lines 152..160
    server/services/zigbee2mqtt/exposes/numericType.js on lines 282..290
    server/services/zigbee2mqtt/exposes/numericType.js on lines 291..299
    server/services/zigbee2mqtt/exposes/numericType.js on lines 300..308
    server/services/zigbee2mqtt/exposes/numericType.js on lines 309..317
    server/services/zigbee2mqtt/exposes/numericType.js on lines 318..326
    server/services/zigbee2mqtt/exposes/numericType.js on lines 327..335
    server/services/zigbee2mqtt/exposes/numericType.js on lines 336..344
    server/services/zigbee2mqtt/exposes/numericType.js on lines 345..353
    server/services/zigbee2mqtt/exposes/numericType.js on lines 354..362
    server/services/zigbee2mqtt/exposes/numericType.js on lines 363..371
    server/services/zigbee2mqtt/exposes/numericType.js on lines 372..380
    server/services/zigbee2mqtt/exposes/numericType.js on lines 500..508
    server/services/zigbee2mqtt/exposes/numericType.js on lines 509..517
    server/services/zigbee2mqtt/exposes/numericType.js on lines 518..526
    server/services/zigbee2mqtt/exposes/numericType.js on lines 527..535
    server/services/zigbee2mqtt/exposes/numericType.js on lines 737..745
    server/services/zigbee2mqtt/exposes/numericType.js on lines 746..754
    server/services/zigbee2mqtt/exposes/numericType.js on lines 755..763

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

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

        ISOUSC: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.ENERGY_SENSOR,
            type: DEVICE_FEATURE_TYPES.ENERGY_SENSOR.CURRENT,
            unit: DEVICE_FEATURE_UNITS.AMPERE,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 24 other locations - About 55 mins to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 27..35
    server/services/zigbee2mqtt/exposes/numericType.js on lines 36..44
    server/services/zigbee2mqtt/exposes/numericType.js on lines 70..78
    server/services/zigbee2mqtt/exposes/numericType.js on lines 87..95
    server/services/zigbee2mqtt/exposes/numericType.js on lines 96..104
    server/services/zigbee2mqtt/exposes/numericType.js on lines 143..151
    server/services/zigbee2mqtt/exposes/numericType.js on lines 152..160
    server/services/zigbee2mqtt/exposes/numericType.js on lines 291..299
    server/services/zigbee2mqtt/exposes/numericType.js on lines 300..308
    server/services/zigbee2mqtt/exposes/numericType.js on lines 309..317
    server/services/zigbee2mqtt/exposes/numericType.js on lines 318..326
    server/services/zigbee2mqtt/exposes/numericType.js on lines 327..335
    server/services/zigbee2mqtt/exposes/numericType.js on lines 336..344
    server/services/zigbee2mqtt/exposes/numericType.js on lines 345..353
    server/services/zigbee2mqtt/exposes/numericType.js on lines 354..362
    server/services/zigbee2mqtt/exposes/numericType.js on lines 363..371
    server/services/zigbee2mqtt/exposes/numericType.js on lines 372..380
    server/services/zigbee2mqtt/exposes/numericType.js on lines 500..508
    server/services/zigbee2mqtt/exposes/numericType.js on lines 509..517
    server/services/zigbee2mqtt/exposes/numericType.js on lines 518..526
    server/services/zigbee2mqtt/exposes/numericType.js on lines 527..535
    server/services/zigbee2mqtt/exposes/numericType.js on lines 737..745
    server/services/zigbee2mqtt/exposes/numericType.js on lines 746..754
    server/services/zigbee2mqtt/exposes/numericType.js on lines 755..763

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

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

        soil_moisture: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.SOIL_MOISTURE_SENSOR,
            type: DEVICE_FEATURE_TYPES.SENSOR.DECIMAL,
            unit: DEVICE_FEATURE_UNITS.PERCENT,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 24 other locations - About 55 mins to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 27..35
    server/services/zigbee2mqtt/exposes/numericType.js on lines 36..44
    server/services/zigbee2mqtt/exposes/numericType.js on lines 70..78
    server/services/zigbee2mqtt/exposes/numericType.js on lines 87..95
    server/services/zigbee2mqtt/exposes/numericType.js on lines 96..104
    server/services/zigbee2mqtt/exposes/numericType.js on lines 143..151
    server/services/zigbee2mqtt/exposes/numericType.js on lines 152..160
    server/services/zigbee2mqtt/exposes/numericType.js on lines 282..290
    server/services/zigbee2mqtt/exposes/numericType.js on lines 291..299
    server/services/zigbee2mqtt/exposes/numericType.js on lines 300..308
    server/services/zigbee2mqtt/exposes/numericType.js on lines 309..317
    server/services/zigbee2mqtt/exposes/numericType.js on lines 318..326
    server/services/zigbee2mqtt/exposes/numericType.js on lines 327..335
    server/services/zigbee2mqtt/exposes/numericType.js on lines 336..344
    server/services/zigbee2mqtt/exposes/numericType.js on lines 345..353
    server/services/zigbee2mqtt/exposes/numericType.js on lines 354..362
    server/services/zigbee2mqtt/exposes/numericType.js on lines 363..371
    server/services/zigbee2mqtt/exposes/numericType.js on lines 372..380
    server/services/zigbee2mqtt/exposes/numericType.js on lines 500..508
    server/services/zigbee2mqtt/exposes/numericType.js on lines 509..517
    server/services/zigbee2mqtt/exposes/numericType.js on lines 518..526
    server/services/zigbee2mqtt/exposes/numericType.js on lines 527..535
    server/services/zigbee2mqtt/exposes/numericType.js on lines 746..754
    server/services/zigbee2mqtt/exposes/numericType.js on lines 755..763

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

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

        current_phase_c: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.SWITCH,
            type: DEVICE_FEATURE_TYPES.SWITCH.CURRENT,
            unit: DEVICE_FEATURE_UNITS.AMPERE,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 24 other locations - About 55 mins to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 27..35
    server/services/zigbee2mqtt/exposes/numericType.js on lines 36..44
    server/services/zigbee2mqtt/exposes/numericType.js on lines 70..78
    server/services/zigbee2mqtt/exposes/numericType.js on lines 87..95
    server/services/zigbee2mqtt/exposes/numericType.js on lines 143..151
    server/services/zigbee2mqtt/exposes/numericType.js on lines 152..160
    server/services/zigbee2mqtt/exposes/numericType.js on lines 282..290
    server/services/zigbee2mqtt/exposes/numericType.js on lines 291..299
    server/services/zigbee2mqtt/exposes/numericType.js on lines 300..308
    server/services/zigbee2mqtt/exposes/numericType.js on lines 309..317
    server/services/zigbee2mqtt/exposes/numericType.js on lines 318..326
    server/services/zigbee2mqtt/exposes/numericType.js on lines 327..335
    server/services/zigbee2mqtt/exposes/numericType.js on lines 336..344
    server/services/zigbee2mqtt/exposes/numericType.js on lines 345..353
    server/services/zigbee2mqtt/exposes/numericType.js on lines 354..362
    server/services/zigbee2mqtt/exposes/numericType.js on lines 363..371
    server/services/zigbee2mqtt/exposes/numericType.js on lines 372..380
    server/services/zigbee2mqtt/exposes/numericType.js on lines 500..508
    server/services/zigbee2mqtt/exposes/numericType.js on lines 509..517
    server/services/zigbee2mqtt/exposes/numericType.js on lines 518..526
    server/services/zigbee2mqtt/exposes/numericType.js on lines 527..535
    server/services/zigbee2mqtt/exposes/numericType.js on lines 737..745
    server/services/zigbee2mqtt/exposes/numericType.js on lines 746..754
    server/services/zigbee2mqtt/exposes/numericType.js on lines 755..763

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

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

        humidity: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.HUMIDITY_SENSOR,
            type: DEVICE_FEATURE_TYPES.SENSOR.DECIMAL,
            unit: DEVICE_FEATURE_UNITS.PERCENT,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 24 other locations - About 55 mins to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 27..35
    server/services/zigbee2mqtt/exposes/numericType.js on lines 36..44
    server/services/zigbee2mqtt/exposes/numericType.js on lines 70..78
    server/services/zigbee2mqtt/exposes/numericType.js on lines 87..95
    server/services/zigbee2mqtt/exposes/numericType.js on lines 96..104
    server/services/zigbee2mqtt/exposes/numericType.js on lines 152..160
    server/services/zigbee2mqtt/exposes/numericType.js on lines 282..290
    server/services/zigbee2mqtt/exposes/numericType.js on lines 291..299
    server/services/zigbee2mqtt/exposes/numericType.js on lines 300..308
    server/services/zigbee2mqtt/exposes/numericType.js on lines 309..317
    server/services/zigbee2mqtt/exposes/numericType.js on lines 318..326
    server/services/zigbee2mqtt/exposes/numericType.js on lines 327..335
    server/services/zigbee2mqtt/exposes/numericType.js on lines 336..344
    server/services/zigbee2mqtt/exposes/numericType.js on lines 345..353
    server/services/zigbee2mqtt/exposes/numericType.js on lines 354..362
    server/services/zigbee2mqtt/exposes/numericType.js on lines 363..371
    server/services/zigbee2mqtt/exposes/numericType.js on lines 372..380
    server/services/zigbee2mqtt/exposes/numericType.js on lines 500..508
    server/services/zigbee2mqtt/exposes/numericType.js on lines 509..517
    server/services/zigbee2mqtt/exposes/numericType.js on lines 518..526
    server/services/zigbee2mqtt/exposes/numericType.js on lines 527..535
    server/services/zigbee2mqtt/exposes/numericType.js on lines 737..745
    server/services/zigbee2mqtt/exposes/numericType.js on lines 746..754
    server/services/zigbee2mqtt/exposes/numericType.js on lines 755..763

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

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

        BBRHCJR: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.ENERGY_SENSOR,
            type: DEVICE_FEATURE_TYPES.ENERGY_SENSOR.INDEX,
            unit: DEVICE_FEATURE_UNITS.KILOWATT_HOUR,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 24 other locations - About 55 mins to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 27..35
    server/services/zigbee2mqtt/exposes/numericType.js on lines 36..44
    server/services/zigbee2mqtt/exposes/numericType.js on lines 70..78
    server/services/zigbee2mqtt/exposes/numericType.js on lines 87..95
    server/services/zigbee2mqtt/exposes/numericType.js on lines 96..104
    server/services/zigbee2mqtt/exposes/numericType.js on lines 143..151
    server/services/zigbee2mqtt/exposes/numericType.js on lines 152..160
    server/services/zigbee2mqtt/exposes/numericType.js on lines 282..290
    server/services/zigbee2mqtt/exposes/numericType.js on lines 291..299
    server/services/zigbee2mqtt/exposes/numericType.js on lines 300..308
    server/services/zigbee2mqtt/exposes/numericType.js on lines 309..317
    server/services/zigbee2mqtt/exposes/numericType.js on lines 318..326
    server/services/zigbee2mqtt/exposes/numericType.js on lines 336..344
    server/services/zigbee2mqtt/exposes/numericType.js on lines 345..353
    server/services/zigbee2mqtt/exposes/numericType.js on lines 354..362
    server/services/zigbee2mqtt/exposes/numericType.js on lines 363..371
    server/services/zigbee2mqtt/exposes/numericType.js on lines 372..380
    server/services/zigbee2mqtt/exposes/numericType.js on lines 500..508
    server/services/zigbee2mqtt/exposes/numericType.js on lines 509..517
    server/services/zigbee2mqtt/exposes/numericType.js on lines 518..526
    server/services/zigbee2mqtt/exposes/numericType.js on lines 527..535
    server/services/zigbee2mqtt/exposes/numericType.js on lines 737..745
    server/services/zigbee2mqtt/exposes/numericType.js on lines 746..754
    server/services/zigbee2mqtt/exposes/numericType.js on lines 755..763

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

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

        HCHP: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.ENERGY_SENSOR,
            type: DEVICE_FEATURE_TYPES.ENERGY_SENSOR.INDEX,
            unit: DEVICE_FEATURE_UNITS.KILOWATT_HOUR,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 24 other locations - About 55 mins to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 27..35
    server/services/zigbee2mqtt/exposes/numericType.js on lines 36..44
    server/services/zigbee2mqtt/exposes/numericType.js on lines 70..78
    server/services/zigbee2mqtt/exposes/numericType.js on lines 87..95
    server/services/zigbee2mqtt/exposes/numericType.js on lines 96..104
    server/services/zigbee2mqtt/exposes/numericType.js on lines 143..151
    server/services/zigbee2mqtt/exposes/numericType.js on lines 152..160
    server/services/zigbee2mqtt/exposes/numericType.js on lines 282..290
    server/services/zigbee2mqtt/exposes/numericType.js on lines 291..299
    server/services/zigbee2mqtt/exposes/numericType.js on lines 309..317
    server/services/zigbee2mqtt/exposes/numericType.js on lines 318..326
    server/services/zigbee2mqtt/exposes/numericType.js on lines 327..335
    server/services/zigbee2mqtt/exposes/numericType.js on lines 336..344
    server/services/zigbee2mqtt/exposes/numericType.js on lines 345..353
    server/services/zigbee2mqtt/exposes/numericType.js on lines 354..362
    server/services/zigbee2mqtt/exposes/numericType.js on lines 363..371
    server/services/zigbee2mqtt/exposes/numericType.js on lines 372..380
    server/services/zigbee2mqtt/exposes/numericType.js on lines 500..508
    server/services/zigbee2mqtt/exposes/numericType.js on lines 509..517
    server/services/zigbee2mqtt/exposes/numericType.js on lines 518..526
    server/services/zigbee2mqtt/exposes/numericType.js on lines 527..535
    server/services/zigbee2mqtt/exposes/numericType.js on lines 737..745
    server/services/zigbee2mqtt/exposes/numericType.js on lines 746..754
    server/services/zigbee2mqtt/exposes/numericType.js on lines 755..763

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

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

        EASF09: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.ENERGY_SENSOR,
            type: DEVICE_FEATURE_TYPES.ENERGY_SENSOR.INDEX,
            unit: DEVICE_FEATURE_UNITS.KILOWATT_HOUR,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 24 other locations - About 55 mins to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 27..35
    server/services/zigbee2mqtt/exposes/numericType.js on lines 36..44
    server/services/zigbee2mqtt/exposes/numericType.js on lines 70..78
    server/services/zigbee2mqtt/exposes/numericType.js on lines 87..95
    server/services/zigbee2mqtt/exposes/numericType.js on lines 96..104
    server/services/zigbee2mqtt/exposes/numericType.js on lines 143..151
    server/services/zigbee2mqtt/exposes/numericType.js on lines 152..160
    server/services/zigbee2mqtt/exposes/numericType.js on lines 282..290
    server/services/zigbee2mqtt/exposes/numericType.js on lines 291..299
    server/services/zigbee2mqtt/exposes/numericType.js on lines 300..308
    server/services/zigbee2mqtt/exposes/numericType.js on lines 309..317
    server/services/zigbee2mqtt/exposes/numericType.js on lines 318..326
    server/services/zigbee2mqtt/exposes/numericType.js on lines 327..335
    server/services/zigbee2mqtt/exposes/numericType.js on lines 336..344
    server/services/zigbee2mqtt/exposes/numericType.js on lines 345..353
    server/services/zigbee2mqtt/exposes/numericType.js on lines 354..362
    server/services/zigbee2mqtt/exposes/numericType.js on lines 372..380
    server/services/zigbee2mqtt/exposes/numericType.js on lines 500..508
    server/services/zigbee2mqtt/exposes/numericType.js on lines 509..517
    server/services/zigbee2mqtt/exposes/numericType.js on lines 518..526
    server/services/zigbee2mqtt/exposes/numericType.js on lines 527..535
    server/services/zigbee2mqtt/exposes/numericType.js on lines 737..745
    server/services/zigbee2mqtt/exposes/numericType.js on lines 746..754
    server/services/zigbee2mqtt/exposes/numericType.js on lines 755..763

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

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

        current: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.SWITCH,
            type: DEVICE_FEATURE_TYPES.SWITCH.CURRENT,
            unit: DEVICE_FEATURE_UNITS.AMPERE,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 24 other locations - About 55 mins to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 27..35
    server/services/zigbee2mqtt/exposes/numericType.js on lines 36..44
    server/services/zigbee2mqtt/exposes/numericType.js on lines 87..95
    server/services/zigbee2mqtt/exposes/numericType.js on lines 96..104
    server/services/zigbee2mqtt/exposes/numericType.js on lines 143..151
    server/services/zigbee2mqtt/exposes/numericType.js on lines 152..160
    server/services/zigbee2mqtt/exposes/numericType.js on lines 282..290
    server/services/zigbee2mqtt/exposes/numericType.js on lines 291..299
    server/services/zigbee2mqtt/exposes/numericType.js on lines 300..308
    server/services/zigbee2mqtt/exposes/numericType.js on lines 309..317
    server/services/zigbee2mqtt/exposes/numericType.js on lines 318..326
    server/services/zigbee2mqtt/exposes/numericType.js on lines 327..335
    server/services/zigbee2mqtt/exposes/numericType.js on lines 336..344
    server/services/zigbee2mqtt/exposes/numericType.js on lines 345..353
    server/services/zigbee2mqtt/exposes/numericType.js on lines 354..362
    server/services/zigbee2mqtt/exposes/numericType.js on lines 363..371
    server/services/zigbee2mqtt/exposes/numericType.js on lines 372..380
    server/services/zigbee2mqtt/exposes/numericType.js on lines 500..508
    server/services/zigbee2mqtt/exposes/numericType.js on lines 509..517
    server/services/zigbee2mqtt/exposes/numericType.js on lines 518..526
    server/services/zigbee2mqtt/exposes/numericType.js on lines 527..535
    server/services/zigbee2mqtt/exposes/numericType.js on lines 737..745
    server/services/zigbee2mqtt/exposes/numericType.js on lines 746..754
    server/services/zigbee2mqtt/exposes/numericType.js on lines 755..763

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

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

        HCHC: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.ENERGY_SENSOR,
            type: DEVICE_FEATURE_TYPES.ENERGY_SENSOR.INDEX,
            unit: DEVICE_FEATURE_UNITS.KILOWATT_HOUR,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 24 other locations - About 55 mins to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 27..35
    server/services/zigbee2mqtt/exposes/numericType.js on lines 36..44
    server/services/zigbee2mqtt/exposes/numericType.js on lines 70..78
    server/services/zigbee2mqtt/exposes/numericType.js on lines 87..95
    server/services/zigbee2mqtt/exposes/numericType.js on lines 96..104
    server/services/zigbee2mqtt/exposes/numericType.js on lines 143..151
    server/services/zigbee2mqtt/exposes/numericType.js on lines 152..160
    server/services/zigbee2mqtt/exposes/numericType.js on lines 282..290
    server/services/zigbee2mqtt/exposes/numericType.js on lines 300..308
    server/services/zigbee2mqtt/exposes/numericType.js on lines 309..317
    server/services/zigbee2mqtt/exposes/numericType.js on lines 318..326
    server/services/zigbee2mqtt/exposes/numericType.js on lines 327..335
    server/services/zigbee2mqtt/exposes/numericType.js on lines 336..344
    server/services/zigbee2mqtt/exposes/numericType.js on lines 345..353
    server/services/zigbee2mqtt/exposes/numericType.js on lines 354..362
    server/services/zigbee2mqtt/exposes/numericType.js on lines 363..371
    server/services/zigbee2mqtt/exposes/numericType.js on lines 372..380
    server/services/zigbee2mqtt/exposes/numericType.js on lines 500..508
    server/services/zigbee2mqtt/exposes/numericType.js on lines 509..517
    server/services/zigbee2mqtt/exposes/numericType.js on lines 518..526
    server/services/zigbee2mqtt/exposes/numericType.js on lines 527..535
    server/services/zigbee2mqtt/exposes/numericType.js on lines 737..745
    server/services/zigbee2mqtt/exposes/numericType.js on lines 746..754
    server/services/zigbee2mqtt/exposes/numericType.js on lines 755..763

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

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

        EASD01: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.ENERGY_SENSOR,
            type: DEVICE_FEATURE_TYPES.ENERGY_SENSOR.INDEX,
            unit: DEVICE_FEATURE_UNITS.KILOWATT_HOUR,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 24 other locations - About 55 mins to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 27..35
    server/services/zigbee2mqtt/exposes/numericType.js on lines 36..44
    server/services/zigbee2mqtt/exposes/numericType.js on lines 70..78
    server/services/zigbee2mqtt/exposes/numericType.js on lines 87..95
    server/services/zigbee2mqtt/exposes/numericType.js on lines 96..104
    server/services/zigbee2mqtt/exposes/numericType.js on lines 143..151
    server/services/zigbee2mqtt/exposes/numericType.js on lines 152..160
    server/services/zigbee2mqtt/exposes/numericType.js on lines 282..290
    server/services/zigbee2mqtt/exposes/numericType.js on lines 291..299
    server/services/zigbee2mqtt/exposes/numericType.js on lines 300..308
    server/services/zigbee2mqtt/exposes/numericType.js on lines 309..317
    server/services/zigbee2mqtt/exposes/numericType.js on lines 318..326
    server/services/zigbee2mqtt/exposes/numericType.js on lines 327..335
    server/services/zigbee2mqtt/exposes/numericType.js on lines 336..344
    server/services/zigbee2mqtt/exposes/numericType.js on lines 345..353
    server/services/zigbee2mqtt/exposes/numericType.js on lines 354..362
    server/services/zigbee2mqtt/exposes/numericType.js on lines 363..371
    server/services/zigbee2mqtt/exposes/numericType.js on lines 372..380
    server/services/zigbee2mqtt/exposes/numericType.js on lines 509..517
    server/services/zigbee2mqtt/exposes/numericType.js on lines 518..526
    server/services/zigbee2mqtt/exposes/numericType.js on lines 527..535
    server/services/zigbee2mqtt/exposes/numericType.js on lines 737..745
    server/services/zigbee2mqtt/exposes/numericType.js on lines 746..754
    server/services/zigbee2mqtt/exposes/numericType.js on lines 755..763

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

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

        BBRHCJW: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.ENERGY_SENSOR,
            type: DEVICE_FEATURE_TYPES.ENERGY_SENSOR.INDEX,
            unit: DEVICE_FEATURE_UNITS.KILOWATT_HOUR,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 24 other locations - About 55 mins to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 27..35
    server/services/zigbee2mqtt/exposes/numericType.js on lines 36..44
    server/services/zigbee2mqtt/exposes/numericType.js on lines 70..78
    server/services/zigbee2mqtt/exposes/numericType.js on lines 87..95
    server/services/zigbee2mqtt/exposes/numericType.js on lines 96..104
    server/services/zigbee2mqtt/exposes/numericType.js on lines 143..151
    server/services/zigbee2mqtt/exposes/numericType.js on lines 152..160
    server/services/zigbee2mqtt/exposes/numericType.js on lines 282..290
    server/services/zigbee2mqtt/exposes/numericType.js on lines 291..299
    server/services/zigbee2mqtt/exposes/numericType.js on lines 300..308
    server/services/zigbee2mqtt/exposes/numericType.js on lines 318..326
    server/services/zigbee2mqtt/exposes/numericType.js on lines 327..335
    server/services/zigbee2mqtt/exposes/numericType.js on lines 336..344
    server/services/zigbee2mqtt/exposes/numericType.js on lines 345..353
    server/services/zigbee2mqtt/exposes/numericType.js on lines 354..362
    server/services/zigbee2mqtt/exposes/numericType.js on lines 363..371
    server/services/zigbee2mqtt/exposes/numericType.js on lines 372..380
    server/services/zigbee2mqtt/exposes/numericType.js on lines 500..508
    server/services/zigbee2mqtt/exposes/numericType.js on lines 509..517
    server/services/zigbee2mqtt/exposes/numericType.js on lines 518..526
    server/services/zigbee2mqtt/exposes/numericType.js on lines 527..535
    server/services/zigbee2mqtt/exposes/numericType.js on lines 737..745
    server/services/zigbee2mqtt/exposes/numericType.js on lines 746..754
    server/services/zigbee2mqtt/exposes/numericType.js on lines 755..763

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

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

        illuminance_lux: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.LIGHT_SENSOR,
            type: DEVICE_FEATURE_TYPES.SENSOR.DECIMAL,
            unit: DEVICE_FEATURE_UNITS.LUX,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 24 other locations - About 55 mins to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 27..35
    server/services/zigbee2mqtt/exposes/numericType.js on lines 36..44
    server/services/zigbee2mqtt/exposes/numericType.js on lines 70..78
    server/services/zigbee2mqtt/exposes/numericType.js on lines 87..95
    server/services/zigbee2mqtt/exposes/numericType.js on lines 96..104
    server/services/zigbee2mqtt/exposes/numericType.js on lines 143..151
    server/services/zigbee2mqtt/exposes/numericType.js on lines 282..290
    server/services/zigbee2mqtt/exposes/numericType.js on lines 291..299
    server/services/zigbee2mqtt/exposes/numericType.js on lines 300..308
    server/services/zigbee2mqtt/exposes/numericType.js on lines 309..317
    server/services/zigbee2mqtt/exposes/numericType.js on lines 318..326
    server/services/zigbee2mqtt/exposes/numericType.js on lines 327..335
    server/services/zigbee2mqtt/exposes/numericType.js on lines 336..344
    server/services/zigbee2mqtt/exposes/numericType.js on lines 345..353
    server/services/zigbee2mqtt/exposes/numericType.js on lines 354..362
    server/services/zigbee2mqtt/exposes/numericType.js on lines 363..371
    server/services/zigbee2mqtt/exposes/numericType.js on lines 372..380
    server/services/zigbee2mqtt/exposes/numericType.js on lines 500..508
    server/services/zigbee2mqtt/exposes/numericType.js on lines 509..517
    server/services/zigbee2mqtt/exposes/numericType.js on lines 518..526
    server/services/zigbee2mqtt/exposes/numericType.js on lines 527..535
    server/services/zigbee2mqtt/exposes/numericType.js on lines 737..745
    server/services/zigbee2mqtt/exposes/numericType.js on lines 746..754
    server/services/zigbee2mqtt/exposes/numericType.js on lines 755..763

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

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

        pm25: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.PM25_SENSOR,
            type: DEVICE_FEATURE_TYPES.SENSOR.DECIMAL,
            unit: DEVICE_FEATURE_UNITS.MICROGRAM_PER_CUBIC_METER,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 24 other locations - About 55 mins to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 27..35
    server/services/zigbee2mqtt/exposes/numericType.js on lines 36..44
    server/services/zigbee2mqtt/exposes/numericType.js on lines 70..78
    server/services/zigbee2mqtt/exposes/numericType.js on lines 87..95
    server/services/zigbee2mqtt/exposes/numericType.js on lines 96..104
    server/services/zigbee2mqtt/exposes/numericType.js on lines 143..151
    server/services/zigbee2mqtt/exposes/numericType.js on lines 152..160
    server/services/zigbee2mqtt/exposes/numericType.js on lines 282..290
    server/services/zigbee2mqtt/exposes/numericType.js on lines 291..299
    server/services/zigbee2mqtt/exposes/numericType.js on lines 300..308
    server/services/zigbee2mqtt/exposes/numericType.js on lines 309..317
    server/services/zigbee2mqtt/exposes/numericType.js on lines 318..326
    server/services/zigbee2mqtt/exposes/numericType.js on lines 327..335
    server/services/zigbee2mqtt/exposes/numericType.js on lines 336..344
    server/services/zigbee2mqtt/exposes/numericType.js on lines 345..353
    server/services/zigbee2mqtt/exposes/numericType.js on lines 354..362
    server/services/zigbee2mqtt/exposes/numericType.js on lines 363..371
    server/services/zigbee2mqtt/exposes/numericType.js on lines 372..380
    server/services/zigbee2mqtt/exposes/numericType.js on lines 500..508
    server/services/zigbee2mqtt/exposes/numericType.js on lines 509..517
    server/services/zigbee2mqtt/exposes/numericType.js on lines 518..526
    server/services/zigbee2mqtt/exposes/numericType.js on lines 527..535
    server/services/zigbee2mqtt/exposes/numericType.js on lines 737..745
    server/services/zigbee2mqtt/exposes/numericType.js on lines 755..763

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

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

        BBRHPJW: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.ENERGY_SENSOR,
            type: DEVICE_FEATURE_TYPES.ENERGY_SENSOR.INDEX,
            unit: DEVICE_FEATURE_UNITS.KILOWATT_HOUR,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 24 other locations - About 55 mins to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 27..35
    server/services/zigbee2mqtt/exposes/numericType.js on lines 36..44
    server/services/zigbee2mqtt/exposes/numericType.js on lines 70..78
    server/services/zigbee2mqtt/exposes/numericType.js on lines 87..95
    server/services/zigbee2mqtt/exposes/numericType.js on lines 96..104
    server/services/zigbee2mqtt/exposes/numericType.js on lines 143..151
    server/services/zigbee2mqtt/exposes/numericType.js on lines 152..160
    server/services/zigbee2mqtt/exposes/numericType.js on lines 282..290
    server/services/zigbee2mqtt/exposes/numericType.js on lines 291..299
    server/services/zigbee2mqtt/exposes/numericType.js on lines 300..308
    server/services/zigbee2mqtt/exposes/numericType.js on lines 309..317
    server/services/zigbee2mqtt/exposes/numericType.js on lines 327..335
    server/services/zigbee2mqtt/exposes/numericType.js on lines 336..344
    server/services/zigbee2mqtt/exposes/numericType.js on lines 345..353
    server/services/zigbee2mqtt/exposes/numericType.js on lines 354..362
    server/services/zigbee2mqtt/exposes/numericType.js on lines 363..371
    server/services/zigbee2mqtt/exposes/numericType.js on lines 372..380
    server/services/zigbee2mqtt/exposes/numericType.js on lines 500..508
    server/services/zigbee2mqtt/exposes/numericType.js on lines 509..517
    server/services/zigbee2mqtt/exposes/numericType.js on lines 518..526
    server/services/zigbee2mqtt/exposes/numericType.js on lines 527..535
    server/services/zigbee2mqtt/exposes/numericType.js on lines 737..745
    server/services/zigbee2mqtt/exposes/numericType.js on lines 746..754
    server/services/zigbee2mqtt/exposes/numericType.js on lines 755..763

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

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

        EASF07: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.ENERGY_SENSOR,
            type: DEVICE_FEATURE_TYPES.ENERGY_SENSOR.INDEX,
            unit: DEVICE_FEATURE_UNITS.KILOWATT_HOUR,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 24 other locations - About 55 mins to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 27..35
    server/services/zigbee2mqtt/exposes/numericType.js on lines 36..44
    server/services/zigbee2mqtt/exposes/numericType.js on lines 70..78
    server/services/zigbee2mqtt/exposes/numericType.js on lines 87..95
    server/services/zigbee2mqtt/exposes/numericType.js on lines 96..104
    server/services/zigbee2mqtt/exposes/numericType.js on lines 143..151
    server/services/zigbee2mqtt/exposes/numericType.js on lines 152..160
    server/services/zigbee2mqtt/exposes/numericType.js on lines 282..290
    server/services/zigbee2mqtt/exposes/numericType.js on lines 291..299
    server/services/zigbee2mqtt/exposes/numericType.js on lines 300..308
    server/services/zigbee2mqtt/exposes/numericType.js on lines 309..317
    server/services/zigbee2mqtt/exposes/numericType.js on lines 318..326
    server/services/zigbee2mqtt/exposes/numericType.js on lines 327..335
    server/services/zigbee2mqtt/exposes/numericType.js on lines 336..344
    server/services/zigbee2mqtt/exposes/numericType.js on lines 354..362
    server/services/zigbee2mqtt/exposes/numericType.js on lines 363..371
    server/services/zigbee2mqtt/exposes/numericType.js on lines 372..380
    server/services/zigbee2mqtt/exposes/numericType.js on lines 500..508
    server/services/zigbee2mqtt/exposes/numericType.js on lines 509..517
    server/services/zigbee2mqtt/exposes/numericType.js on lines 518..526
    server/services/zigbee2mqtt/exposes/numericType.js on lines 527..535
    server/services/zigbee2mqtt/exposes/numericType.js on lines 737..745
    server/services/zigbee2mqtt/exposes/numericType.js on lines 746..754
    server/services/zigbee2mqtt/exposes/numericType.js on lines 755..763

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

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

        EASF08: {
          feature: {
            category: DEVICE_FEATURE_CATEGORIES.ENERGY_SENSOR,
            type: DEVICE_FEATURE_TYPES.ENERGY_SENSOR.INDEX,
            unit: DEVICE_FEATURE_UNITS.KILOWATT_HOUR,
    Severity: Major
    Found in server/services/zigbee2mqtt/exposes/numericType.js and 24 other locations - About 55 mins to fix
    server/services/zigbee2mqtt/exposes/numericType.js on lines 27..35
    server/services/zigbee2mqtt/exposes/numericType.js on lines 36..44
    server/services/zigbee2mqtt/exposes/numericType.js on lines 70..78
    server/services/zigbee2mqtt/exposes/numericType.js on lines 87..95
    server/services/zigbee2mqtt/exposes/numericType.js on lines 96..104
    server/services/zigbee2mqtt/exposes/numericType.js on lines 143..151
    server/services/zigbee2mqtt/exposes/numericType.js on lines 152..160
    server/services/zigbee2mqtt/exposes/numericType.js on lines 282..290
    server/services/zigbee2mqtt/exposes/numericType.js on lines 291..299
    server/services/zigbee2mqtt/exposes/numericType.js on lines 300..308
    server/services/zigbee2mqtt/exposes/numericType.js on lines 309..317
    server/services/zigbee2mqtt/exposes/numericType.js on lines 318..326
    server/services/zigbee2mqtt/exposes/numericType.js on lines 327..335
    server/services/zigbee2mqtt/exposes/numericType.js on lines 336..344
    server/services/zigbee2mqtt/exposes/numericType.js on lines 345..353
    server/services/zigbee2mqtt/exposes/numericType.js on lines 363..371
    server/services/zigbee2mqtt/exposes/numericType.js on lines 372..380
    server/services/zigbee2mqtt/exposes/numericType.js on lines 500..508
    server/services/zigbee2mqtt/exposes/numericType.js on lines 509..517
    server/services/zigbee2mqtt/exposes/numericType.js on lines 518..526
    server/services/zigbee2mqtt/exposes/numericType.js on lines 527..535
    server/services/zigbee2mqtt/exposes/numericType.js on lines 737..745
    server/services/zigbee2mqtt/exposes/numericType.js on lines 746..754
    server/services/zigbee2mqtt/exposes/numericType.js on lines 755..763

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

    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

    There are no issues that match your filters.

    Category
    Status