danielwippermann/resol-vbus

View on GitHub

Showing 557 of 557 total issues

Function _generateSpecificationData has 157 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _generateSpecificationData(language) {
        const that = this;

        let units = {
            ...this.knownUnitsByCode,
Severity: Major
Found in src/specification-file.js - About 6 hrs to fix

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

        optimizeSolarWfConfiguration($) {
            $(/^Solar_Wf([0-9]+)_Type$/).forEach((value) => {
                const prefix = '^Solar_Wf' + value.md [1] + '_';
    
                value.in([ 0, '#Frei' ], () => {
    src/configuration-optimizers/resol-deltasol-bx-plus-xxx-configuration-optimizer.js on lines 73..95
    src/configuration-optimizers/resol-deltasol-mx-112-configuration-optimizer.js on lines 81..103
    src/configuration-optimizers/resol-deltasol-slt-102-configuration-optimizer.js on lines 57..79

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

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

        optimizeSolarWfConfiguration($) {
            $(/^Solar_Wf([0-9]+)_Type$/).forEach((value) => {
                const prefix = '^Solar_Wf' + value.md [1] + '_';
    
                value.in([ 0, '#Frei' ], () => {
    src/configuration-optimizers/resol-deltasol-bx-plus-xxx-configuration-optimizer.js on lines 73..95
    src/configuration-optimizers/resol-deltasol-mx-2xx-configuration-optimizer.js on lines 96..118
    src/configuration-optimizers/resol-deltasol-slt-102-configuration-optimizer.js on lines 57..79

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

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

        optimizeSolarWfConfiguration($) {
            $(/^Solar_Wf([0-9]+)_Type$/).forEach((value) => {
                const prefix = '^Solar_Wf' + value.md [1] + '_';
    
                value.in([ 0, '#Frei' ], () => {
    src/configuration-optimizers/resol-deltasol-mx-112-configuration-optimizer.js on lines 81..103
    src/configuration-optimizers/resol-deltasol-mx-2xx-configuration-optimizer.js on lines 96..118
    src/configuration-optimizers/resol-deltasol-slt-102-configuration-optimizer.js on lines 57..79

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

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

        optimizeSolarWfConfiguration($) {
            $(/^Solar_Wf([0-9]+)_Type$/).forEach((value) => {
                const prefix = '^Solar_Wf' + value.md [1] + '_';
    
                value.in([ 0, '#Frei' ], () => {
    src/configuration-optimizers/resol-deltasol-bx-plus-xxx-configuration-optimizer.js on lines 73..95
    src/configuration-optimizers/resol-deltasol-mx-112-configuration-optimizer.js on lines 81..103
    src/configuration-optimizers/resol-deltasol-mx-2xx-configuration-optimizer.js on lines 96..118

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

    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 main has 148 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    async function main(options) {
        const { signal, onListen, onRunning } = (options || {});
    
        logger.debug('Starting server...');
    
    
    Severity: Major
    Found in examples/json-live-data-server/index.js - About 5 hrs to fix

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

              if (hasOwnProperty(options, 'frameData') && hasOwnProperty(options, 'dontCopyFrameData') && options.dontCopyFrameData) {
                  this.frameData = options.frameData;
              } else {
                  this.frameData = Buffer.alloc(3 * 7);
                  this.frameData.fill(0);
      Severity: Major
      Found in src/telegram.js and 1 other location - About 5 hrs to fix
      src/packet.js on lines 57..67

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

      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

              if (hasOwnProperty(options, 'frameData') && hasOwnProperty(options, 'dontCopyFrameData') && options.dontCopyFrameData) {
                  this.frameData = options.frameData;
              } else {
                  this.frameData = Buffer.alloc(127 * 4);
                  this.frameData.fill(0);
      Severity: Major
      Found in src/packet.js and 1 other location - About 5 hrs to fix
      src/telegram.js on lines 36..46

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

      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 _onConnection has 144 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _onConnection(socket) {
              const _this = this;
      
              const connectionInfo = {
                  socket,
      Severity: Major
      Found in src/tcp-connection-endpoint.js - About 5 hrs to fix

        Function transceiveValue has 140 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Function main has 140 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          async function main(args) {
              let inputRscFilename = null;
              let inputImageFilename = null;
              let outputJsFilename = null;
          
          
          Severity: Major
          Found in tools/rsc-scheme-converter/main.js - About 5 hrs to fix

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

                _deserializeTranslationGroup(parent, model) {
                    this._filterProperties(parent, function(key, child) {
                        switch (key) {
                        case 'from':
                            model.from = this._getStringValue(child);
            tools/configuration-importer/configuration-xml-deserializer.js on lines 32..51
            tools/configuration-importer/configuration-xml-deserializer.js on lines 149..168

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

            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

                _deserializeLanguage(parent, model) {
                    this._filterProperties(parent, function(key, child) {
                        switch (key) {
                        case 'id':
                            model.id = this._getStringValue(child);
            tools/configuration-importer/configuration-xml-deserializer.js on lines 53..72
            tools/configuration-importer/configuration-xml-deserializer.js on lines 149..168

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

            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

                _deserializeTypeValueText(parent, model) {
                    this._filterProperties(parent, function(key, child) {
                        switch (key) {
                        case 'id':
                            model.id = this._getStringValue(child);
            tools/configuration-importer/configuration-xml-deserializer.js on lines 32..51
            tools/configuration-importer/configuration-xml-deserializer.js on lines 53..72

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

            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 receive has 123 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

              Function onData has 121 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      const onData = function(chunk) {
                          if (phase < 1000) {
                              let buffer;
                              if (rxBuffer) {
                                  buffer = Buffer.concat([ rxBuffer, chunk ]);
              Severity: Major
              Found in src/tcp-connection-endpoint.js - About 4 hrs to fix

                Function _generateSpecificationData has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                Open

                    _generateSpecificationData(language) {
                        const that = this;
                
                        let units = {
                            ...this.knownUnitsByCode,
                Severity: Minor
                Found in src/specification-file.js - About 4 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

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

                            const createBuffer = function(type, length, timestamp) {
                                const buffer = Buffer.alloc(length);
                                buffer.fill(0);
                
                                buffer [0] = 0xA5;
                Severity: Major
                Found in src/vbus-recording-converter.js and 2 other locations - About 4 hrs to fix
                src/vbus-recording-converter.js on lines 111..122
                src/vbus-recording-converter.js on lines 155..166

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

                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

                        const createBuffer = function(type, length, timestamp) {
                            const buffer = Buffer.alloc(length);
                            buffer.fill(0);
                
                            buffer [0] = 0xA5;
                Severity: Major
                Found in src/vbus-recording-converter.js and 2 other locations - About 4 hrs to fix
                src/vbus-recording-converter.js on lines 73..84
                src/vbus-recording-converter.js on lines 111..122

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

                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

                            const createBuffer = function(type, length, timestamp) {
                                const buffer = Buffer.alloc(length);
                                buffer.fill(0);
                
                                buffer [0] = 0xA5;
                Severity: Major
                Found in src/vbus-recording-converter.js and 2 other locations - About 4 hrs to fix
                src/vbus-recording-converter.js on lines 73..84
                src/vbus-recording-converter.js on lines 155..166

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

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

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

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

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

                Refactorings

                Further Reading

                Severity
                Category
                Status
                Source
                Language