danielwippermann/resol-vbus

View on GitHub

Showing 557 of 557 total issues

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

var rawConfiguration = {
    "languages": [
        {
            "texts": [
                {
Severity: Major
Found in src/configuration-optimizers/resol-deltasol-cs2-200-data.js and 1 other location - About 2 mos to fix
src/configuration-optimizers/resol-deltasol-cs4-200-data.js on lines 3..2882

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

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

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

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

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

Refactorings

Further Reading

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

var rawConfiguration = {
    "languages": [
        {
            "texts": [
                {
Severity: Major
Found in src/configuration-optimizers/resol-deltasol-cs4-200-data.js and 1 other location - About 2 mos to fix
src/configuration-optimizers/resol-deltasol-cs2-200-data.js on lines 3..2882

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

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 resol-deltasol-cs2-200-data.js has 2881 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

var rawConfiguration = {
    "languages": [
        {
Severity: Major
Found in src/configuration-optimizers/resol-deltasol-cs2-200-data.js - About 1 wk to fix

    File resol-deltasol-cs4-200-data.js has 2881 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*! resol-vbus | Copyright (c) 2013-present, Daniel Wippermann | MIT license */
    
    var rawConfiguration = {
        "languages": [
            {
    Severity: Major
    Found in src/configuration-optimizers/resol-deltasol-cs4-200-data.js - About 1 wk to fix

      File resol-deltasol-cs-plus-110-data.js has 2648 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*! resol-vbus | Copyright (c) 2013-present, Daniel Wippermann | MIT license */
      
      var rawConfiguration = {
          "languages": [
              {
      Severity: Major
      Found in src/configuration-optimizers/resol-deltasol-cs-plus-110-data.js - About 1 wk to fix

        File resol-deltasol-bs4v2-103-data.js has 2596 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*! resol-vbus | Copyright (c) 2013-present, Daniel Wippermann | MIT license */
        
        var rawConfiguration = {
            "languages": [
                {
        Severity: Major
        Found in src/configuration-optimizers/resol-deltasol-bs4v2-103-data.js - About 1 wk to fix

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

          /*! resol-vbus | Copyright (c) 2013-present, Daniel Wippermann | MIT license */
          
          const crypto = require('crypto');
          
          
          
          Severity: Major
          Found in src/specification.js - About 3 days to fix

            File resol-deltasol-c-104-data.js has 1112 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*! resol-vbus | Copyright (c) 2013-present, Daniel Wippermann | MIT license */
            
            var rawConfiguration = {
                "languages": [
                    {
            Severity: Major
            Found in src/configuration-optimizers/resol-deltasol-c-104-data.js - About 2 days to fix

              Function receive has a Cognitive Complexity of 111 (exceeds 5 allowed). Consider refactoring.
              Open

                  receive(timestamp, chunk) {
                      const _this = this;
              
                      if (this.listenerCount('rawData') > 0) {
                          this.emit('rawData', chunk, timestamp);
              Severity: Minor
              Found in src/connection.js - About 2 days to fix

              Cognitive Complexity

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

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

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

              Further reading

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

                      switch (targetUnitCode) {
                      case 'WattHours':
                          // nop
                          break;
                      case 'KilowattHours':
              Severity: Major
              Found in src/specification.js and 1 other location - About 1 day to fix
              src/specification.js on lines 906..945

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

              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

                      switch (sourceUnitCode) {
                      case 'WattHours':
                          // nop
                          break;
                      case 'KilowattHours':
              Severity: Major
              Found in src/specification.js and 1 other location - About 1 day to fix
              src/specification.js on lines 947..986

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

              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 crc16Table = [
                  0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
                  0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7,
                  0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e,
                  0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876,
              Severity: Major
              Found in src/specification-file.js and 1 other location - About 1 day to fix
              src/header.js on lines 10..43

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

              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 crc7Table = [
                  0x00, 0x09, 0x12, 0x1b, 0x24, 0x2d, 0x36, 0x3f,
                  0x48, 0x41, 0x5a, 0x53, 0x6c, 0x65, 0x7e, 0x77,
                  0x19, 0x10, 0x0b, 0x02, 0x3d, 0x34, 0x2f, 0x26,
                  0x51, 0x58, 0x43, 0x4a, 0x75, 0x7c, 0x67, 0x6e,
              Severity: Major
              Found in src/header.js and 1 other location - About 1 day to fix
              src/specification-file.js on lines 21..54

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

              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

                  optimizeHeizungHeizkreisConfiguration($) {
                      $(/^(Heizung_Heizkreis[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 162..186
              src/configuration-optimizers/resol-deltatherm-hc-xxx-configuration-optimizer.js on lines 75..99

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

              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

                  optimizeHeizungHeizkreisConfiguration($) {
                      $(/^(Heizung_Heizkreis[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 154..178
              src/configuration-optimizers/resol-deltasol-mx-112-configuration-optimizer.js on lines 162..186

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

              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

                  optimizeHeizungHeizkreisConfiguration($) {
                      $(/^(Heizung_Heizkreis[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 154..178
              src/configuration-optimizers/resol-deltatherm-hc-xxx-configuration-optimizer.js on lines 75..99

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

              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 connection.js has 622 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*! resol-vbus | Copyright (c) 2013-present, Daniel Wippermann | MIT license */
              
              const { Duplex } = require('stream');
              
              
              
              Severity: Major
              Found in src/connection.js - About 1 day to fix

                File index.js has 600 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: Major
                Found in examples/json-live-data-server/index.js - About 1 day to fix

                  Function _onConnection has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
                  Open

                      _onConnection(socket) {
                          const _this = this;
                  
                          const connectionInfo = {
                              socket,
                  Severity: Minor
                  Found in src/tcp-connection-endpoint.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

                  Function _connect has 235 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      _connect(force) {
                          const _this = this;
                  
                          let socket;
                  
                  
                  Severity: Major
                  Found in src/tcp-connection.js - About 1 day to fix
                    Severity
                    Category
                    Status
                    Source
                    Language