danielwippermann/resol-vbus

View on GitHub

Showing 557 of 557 total issues

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

        value.lt(70, () => {
            $(/^Solar_Sp4_.*/).ignore();
            $(/^Solar_Wf4_(ExtWT)_.*/).ignore();
        });
src/configuration-optimizers/resol-deltasol-bx-plus-xxx-configuration-optimizer.js on lines 41..44
src/configuration-optimizers/resol-deltasol-bx-plus-xxx-configuration-optimizer.js on lines 50..53
src/configuration-optimizers/resol-deltasol-bx-plus-xxx-configuration-optimizer.js on lines 59..62
src/configuration-optimizers/resol-deltasol-mx-112-configuration-optimizer.js on lines 41..44
src/configuration-optimizers/resol-deltasol-mx-112-configuration-optimizer.js on lines 54..57
src/configuration-optimizers/resol-deltasol-mx-112-configuration-optimizer.js on lines 63..66
src/configuration-optimizers/resol-deltasol-mx-112-configuration-optimizer.js on lines 67..70
src/configuration-optimizers/resol-deltasol-mx-112-configuration-optimizer.js on lines 71..74
src/configuration-optimizers/resol-deltasol-slt-102-configuration-optimizer.js on lines 33..36
src/configuration-optimizers/resol-deltasol-slt-102-configuration-optimizer.js on lines 42..45

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

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

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

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

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

Refactorings

Further Reading

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

            this.emit('rawData', {
                startTimestamp: new Date(timestamp),
                endTimestamp: new Date(endTimestamp),
                channel: this.currentChannel,
                buffer: rawBuffer,
Severity: Minor
Found in src/vbus-recording-converter.js and 1 other location - About 30 mins to fix
src/vbus-recording-converter.js on lines 526..531

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

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

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

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

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

Refactorings

Further Reading

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

        const endDate = req.query.endDate ? i18n.momentUtc(req.query.endDate, 'MM/DD/YYYY') : i18n.momentUtc();
Severity: Minor
Found in examples/vbustouch-proxy/index.js and 1 other location - About 30 mins to fix
examples/vbustouch-proxy/index.js on lines 268..268

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

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

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

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

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

Refactorings

Further Reading

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

        const startDate = req.query.startDate ? i18n.momentUtc(req.query.startDate, 'MM/DD/YYYY') : i18n.momentUtc();
Severity: Minor
Found in examples/vbustouch-proxy/index.js and 1 other location - About 30 mins to fix
examples/vbustouch-proxy/index.js on lines 269..269

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

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

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

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

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

Refactorings

Further Reading

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

            this.emit('rawData', {
                startTimestamp: new Date(startTimestamp),
                endTimestamp: new Date(endTimestamp),
                channel: this.currentChannel,
                buffer: rawBuffer,
Severity: Minor
Found in src/vbus-recording-converter.js and 1 other location - About 30 mins to fix
src/vbus-recording-converter.js on lines 428..433

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

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

        value.lt(90, () => {
            $(/^Solar_Sp5_.*/).ignore();
            $(/^Solar_Wf5_(ExtWT)_.*/).ignore();
        });
src/configuration-optimizers/resol-deltasol-bx-plus-xxx-configuration-optimizer.js on lines 41..44
src/configuration-optimizers/resol-deltasol-bx-plus-xxx-configuration-optimizer.js on lines 50..53
src/configuration-optimizers/resol-deltasol-bx-plus-xxx-configuration-optimizer.js on lines 59..62
src/configuration-optimizers/resol-deltasol-bx-plus-xxx-configuration-optimizer.js on lines 63..66
src/configuration-optimizers/resol-deltasol-mx-112-configuration-optimizer.js on lines 41..44
src/configuration-optimizers/resol-deltasol-mx-112-configuration-optimizer.js on lines 54..57
src/configuration-optimizers/resol-deltasol-mx-112-configuration-optimizer.js on lines 63..66
src/configuration-optimizers/resol-deltasol-mx-112-configuration-optimizer.js on lines 67..70
src/configuration-optimizers/resol-deltasol-slt-102-configuration-optimizer.js on lines 33..36
src/configuration-optimizers/resol-deltasol-slt-102-configuration-optimizer.js on lines 42..45

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

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

        value.lt(70, () => {
            $(/^Solar_Sp4_.*/).ignore();
            $(/^Solar_Wf4_(ExtWT)_.*/).ignore();
        });
src/configuration-optimizers/resol-deltasol-bx-plus-xxx-configuration-optimizer.js on lines 41..44
src/configuration-optimizers/resol-deltasol-bx-plus-xxx-configuration-optimizer.js on lines 50..53
src/configuration-optimizers/resol-deltasol-bx-plus-xxx-configuration-optimizer.js on lines 59..62
src/configuration-optimizers/resol-deltasol-bx-plus-xxx-configuration-optimizer.js on lines 63..66
src/configuration-optimizers/resol-deltasol-mx-112-configuration-optimizer.js on lines 41..44
src/configuration-optimizers/resol-deltasol-mx-112-configuration-optimizer.js on lines 54..57
src/configuration-optimizers/resol-deltasol-mx-112-configuration-optimizer.js on lines 63..66
src/configuration-optimizers/resol-deltasol-mx-112-configuration-optimizer.js on lines 71..74
src/configuration-optimizers/resol-deltasol-slt-102-configuration-optimizer.js on lines 33..36
src/configuration-optimizers/resol-deltasol-slt-102-configuration-optimizer.js on lines 42..45

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

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

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

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

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

Refactorings

Further Reading

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

class LanguageModel extends BaseModel {

    constructor() {
        super();

Severity: Minor
Found in tools/configuration-importer/models.js and 2 other locations - About 30 mins to fix
tools/configuration-importer/models.js on lines 79..88
tools/configuration-importer/models.js on lines 116..125

Duplicated Code

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

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

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

Tuning

This issue has a mass of 45.

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

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

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

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

Refactorings

Further Reading

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

class TypeValueTextModel extends BaseModel {

    constructor() {
        super();

Severity: Minor
Found in tools/configuration-importer/models.js and 2 other locations - About 30 mins to fix
tools/configuration-importer/models.js on lines 43..52
tools/configuration-importer/models.js on lines 79..88

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

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

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

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

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

Refactorings

Further Reading

Function performTransaction has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

async function performTransaction(connection, fn) {
    let result;

    logger.debug('Waiting for free bus...');

Severity: Minor
Found in examples/customizer2/src/customizer.js - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function roundNumber has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    roundNumber(value, exp) {
        if ((value === undefined) || (exp === undefined) || (+exp === 0)) {
            return value;
        }

Severity: Minor
Found in src/utils.js - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function setBulkValueById has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    setBulkValueById(address, valueId, value, options) {
        const _this = this;

        options = applyDefaultOptions({}, options, {
            timeout: 500,
Severity: Minor
Found in src/connection.js - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function $ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    $(pattern, values) {
        if (values === undefined) {
            ({ values } = this);
        }

Severity: Minor
Found in src/base-configuration-optimizer.js - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function getValueIdHashById has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    getValueIdHashById(address, valueId, options) {
        const _this = this;

        options = applyDefaultOptions({}, options, {
            timeout: 500,
Severity: Minor
Found in src/connection.js - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function discoverDevices has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    static async discoverDevices(options) {
        let promises;
        if (options && (options.family === 'IPv6')) {
            promises = await TcpDataSourceProvider.sendBroadcastIPv6(options);
        } else {
Severity: Minor
Found in src/tcp-data-source-provider.js - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function _write has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    _write(chunk, encoding, callback) {
        if (this.objectMode) {
            if (chunk instanceof HeaderSet) {
                this.emit('headerSet', chunk);
            } else if (chunk instanceof Header) {
Severity: Minor
Found in src/converter.js - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function matchOptimizer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    async matchOptimizer(options) {
        options = {
            ...options,
        };

Severity: Minor
Found in src/configuration-optimizer-factory.js - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Severity
Category
Status
Source
Language