danielwippermann/resol-vbus

View on GitHub

Showing 557 of 557 total issues

Function transceiveValue has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
Open

    async transceiveValue(valueInfo, value, options, state) {
        if (!isObject(valueInfo)) {
            valueInfo = {
                valueIndex: valueInfo,
            };
Severity: Minor
Found in src/connection-customizer.js - About 1 day to fix

Cognitive Complexity

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

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

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

Further reading

File specification-file.js has 540 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*! resol-vbus | Copyright (c) 2016-present, Daniel Wippermann | MIT license */

const fs = require('fs');
const path = require('path');

Severity: Major
Found in src/specification-file.js - About 1 day to fix

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

        const onHeaderSet = async (headerSet) => {
            const datecode = specification.i18n.moment(headerSet.timestamp).format('YYYYMMDD');
            if (currentDatecode !== datecode) {
                currentDatecode = datecode;
    
    
    Severity: Major
    Found in examples/vbustouch-proxy/index.js and 1 other location - About 1 day to fix
    examples/json-live-data-server/index.js on lines 686..713

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

    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 onHeaderSet = async (headerSet) => {
                const datecode = spec.i18n.moment(headerSet.timestamp).format('YYYYMMDD');
                if (currentDatecode !== datecode) {
                    currentDatecode = datecode;
    
    
    Severity: Major
    Found in examples/json-live-data-server/index.js and 1 other location - About 1 day to fix
    examples/vbustouch-proxy/index.js on lines 611..638

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

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

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

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

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

    Refactorings

    Further Reading

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

        optimizeAnlageWfConfiguration($) {
            $(/^(Anlage_Wf[0-9]+)_Type$/).forEach((value) => {
                const prefix = '^' + value.md [1] + '_';
    
                value.eql('#Frei', () => {
    src/configuration-optimizers/resol-deltasol-bx-plus-xxx-configuration-optimizer.js on lines 97..127
    src/configuration-optimizers/resol-deltasol-mx-112-configuration-optimizer.js on lines 105..135

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

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

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

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

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

    Refactorings

    Further Reading

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

        optimizeAnlageWfConfiguration($) {
            $(/^(Anlage_Wf[0-9]+)_Type$/).forEach((value) => {
                const prefix = '^' + value.md [1] + '_';
    
                value.eql('#Frei', () => {
    src/configuration-optimizers/resol-deltasol-mx-112-configuration-optimizer.js on lines 105..135
    src/configuration-optimizers/resol-deltasol-slt-102-configuration-optimizer.js on lines 81..111

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

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

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

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

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

    Refactorings

    Further Reading

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

        optimizeAnlageWfConfiguration($) {
            $(/^(Anlage_Wf[0-9]+)_Type$/).forEach((value) => {
                const prefix = '^' + value.md [1] + '_';
    
                value.eql('#Frei', () => {
    src/configuration-optimizers/resol-deltasol-bx-plus-xxx-configuration-optimizer.js on lines 97..127
    src/configuration-optimizers/resol-deltasol-slt-102-configuration-optimizer.js on lines 81..111

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

    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

        getCaps1(address, options) {
            const _this = this;
    
            options = applyDefaultOptions({}, options, {
                timeout: 500,
    Severity: Major
    Found in src/connection.js and 2 other locations - About 1 day to fix
    src/connection.js on lines 762..792
    src/connection.js on lines 805..835

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 198.

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

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

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

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

    Refactorings

    Further Reading

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

        rollbackBulkValueTransaction(address, options) {
            const _this = this;
    
            options = applyDefaultOptions({}, options, {
                timeout: 500,
    Severity: Major
    Found in src/connection.js and 2 other locations - About 1 day to fix
    src/connection.js on lines 675..705
    src/connection.js on lines 762..792

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 198.

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

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

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

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

    Refactorings

    Further Reading

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

        commitBulkValueTransaction(address, options) {
            const _this = this;
    
            options = applyDefaultOptions({}, options, {
                timeout: 500,
    Severity: Major
    Found in src/connection.js and 2 other locations - About 1 day to fix
    src/connection.js on lines 675..705
    src/connection.js on lines 805..835

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 198.

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

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

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

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

    Refactorings

    Further Reading

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

        optimizeHeizungWfConfiguration($) {
            $(/^(Heizung_Wf[0-9]+)_Type$/).forEach((value) => {
                const prefix = '^' + value.md [1] + '_';
    
                value.eql('#Frei', () => {
    src/configuration-optimizers/resol-deltasol-bx-plus-xxx-configuration-optimizer.js on lines 129..152
    src/configuration-optimizers/resol-deltasol-slt-102-configuration-optimizer.js on lines 113..136

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

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

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

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

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

    Refactorings

    Further Reading

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

        optimizeHeizungWfConfiguration($) {
            $(/^(Heizung_Wf[0-9]+)_Type$/).forEach((value) => {
                const prefix = '^' + value.md [1] + '_';
    
                value.eql('#Frei', () => {
    src/configuration-optimizers/resol-deltasol-mx-112-configuration-optimizer.js on lines 137..160
    src/configuration-optimizers/resol-deltasol-slt-102-configuration-optimizer.js on lines 113..136

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

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

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

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

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

    Refactorings

    Further Reading

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

        optimizeHeizungWfConfiguration($) {
            $(/^(Heizung_Wf[0-9]+)_Type$/).forEach((value) => {
                const prefix = '^' + value.md [1] + '_';
    
                value.eql('#Frei', () => {
    src/configuration-optimizers/resol-deltasol-bx-plus-xxx-configuration-optimizer.js on lines 129..152
    src/configuration-optimizers/resol-deltasol-mx-112-configuration-optimizer.js on lines 137..160

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

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

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

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

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

    Refactorings

    Further Reading

    File index.js has 490 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*! resol-vbus | Copyright (c) 2013-present, Daniel Wippermann | MIT license */
    
    const fs = require('fs');
    const os = require('os');
    const path = require('path');
    Severity: Minor
    Found in examples/vbustouch-proxy/index.js - About 7 hrs to fix

      Function completeConfiguration has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
      Open

          async completeConfiguration(...configs) {
              const _this = this;
      
              const adjustableValues = _this._getAdjustableValues();
      
      
      Severity: Minor
      Found in src/base-configuration-optimizer.js - About 7 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      File configuration-xml-deserializer.js has 469 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*! resol-vbus | Copyright (c) 2013-present, Daniel Wippermann | MIT license */
      
      const _ = require('lodash');
      
      
      
      Severity: Minor
      Found in tools/configuration-importer/configuration-xml-deserializer.js - About 7 hrs to fix

        Function _parseBuffer has 180 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            _parseBuffer(buffer) {
                const that = this;
        
                const sliceBlock = function(name, offset, size) {
                    if ((offset < 0) || (offset > buffer.length)) {
        Severity: Major
        Found in src/specification-file.js - About 7 hrs to fix

          File vbus-recording-converter.js has 458 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*! resol-vbus | Copyright (c) 2013-present, Daniel Wippermann | MIT license */
          
          const moreints = require('buffer-more-ints');
          
          
          
          Severity: Minor
          Found in src/vbus-recording-converter.js - About 7 hrs to fix

            Function _getAdjustableValues has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
            Open

                _getAdjustableValues() {
                    const data = this.constructor.configurationData;
            
                    const typeById = (data.types || []).reduce((memo, type) => {
                        memo [type.id] = type;
            Severity: Minor
            Found in src/base-configuration-optimizer.js - About 6 hrs to fix

            Cognitive Complexity

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

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

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

            Further reading

            File base-configuration-optimizer.js has 434 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*! resol-vbus | Copyright (c) 2013-present, Daniel Wippermann | MIT license */
            
            const ConfigurationOptimizer = require('./configuration-optimizer');
            const {
                isNumber,
            Severity: Minor
            Found in src/base-configuration-optimizer.js - About 6 hrs to fix
              Severity
              Category
              Status
              Source
              Language