danielwippermann/resol-vbus

View on GitHub

Showing 212 of 557 total issues

Function mergeType has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    const mergeType = function(info, type) {
        if (type.base) {
            const baseType = typeById [type.base];
            if (baseType) {
                mergeType(info, baseType);
Severity: Minor
Found in tools/configuration-importer/index.js - About 1 hr to fix

    Function generateDLxDownloadDownloadResponse has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    async function generateDLxDownloadDownloadResponse(rawQuery) {
        const query = {
            source: rawQuery.source,
            outputType: rawQuery.outputType,
            dataLanguage: rawQuery.dataLanguage || 'en',
    Severity: Minor
    Found in examples/json-live-data-server/index.js - About 1 hr to fix

      Function getRawValue has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          getRawValue(packetField, buffer, start, end) {
              if (start === undefined) {
                  start = 0;
              }
              if (end === undefined) {
      Severity: Minor
      Found in src/specification.js - About 1 hr 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 getBlockTypeFieldsForSections has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          getBlockTypeFieldsForSections(sections) {
              const _this = this;
      
              const sectionByBlockTypeId = sections.reduce((memo, section) => {
                  memo [section.sectionId] = section;
      Severity: Minor
      Found in src/specification.js - About 1 hr 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 normalizeDatecode has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          normalizeDatecode(input) {
              let output;
              if (input == null) {
                  output = null;
              } else if (typeof input === 'number') {
      Severity: Minor
      Found in src/utils.js - About 1 hr 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 setRawValue has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          setRawValue(packetField, rawValue, buffer, start, end) {
              if (start === undefined) {
                  start = 0;
              }
              if (end === undefined) {
      Severity: Minor
      Found in src/specification.js - About 1 hr 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 runSingleShot has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      const runSingleShot = async (argv) => {
          const context = {};
      
          try {
              if (argv.q) {
      Severity: Minor
      Found in examples/customizer/index.js - About 1 hr 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 updateAsync has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          async function updateAsync(options) {
              const {
                  width,
                  height,
                  backgroundImageUrl,
      Severity: Minor
      Found in examples/json-live-data-server/public/script.js - About 1 hr to fix

        Function formatTextValueFromRawValueInternal has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            formatTextValueFromRawValueInternal(rawValue, unit, rootType, precision, defaultUnit) {
                const unitText = unit ? unit.unitText : defaultUnit ? defaultUnit.unitText : '';
        
                let result, textValue, format;
                if ((rawValue === undefined) || (rawValue === null)) {
        Severity: Minor
        Found in src/specification.js - About 1 hr to fix

          Function getValueById has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              getValueById(address, valueId, options) {
                  const _this = this;
          
                  options = applyDefaultOptions({}, options, {
                      timeout: 500,
          Severity: Minor
          Found in src/connection.js - About 1 hr 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 getPacketSpecification has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              getPacketSpecification(headerOrChannel, destinationAddress, sourceAddress, command) {
                  if (typeof headerOrChannel === 'object') {
                      ({ command, sourceAddress, destinationAddress } = headerOrChannel);
                      headerOrChannel = headerOrChannel.channel;
                  } else if (typeof headerOrChannel === 'string') {
          Severity: Minor
          Found in src/specification.js - About 1 hr 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 storeSpecificationData has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              static storeSpecificationData(options) {
                  if (options === undefined) {
                      options = {};
                  }
                  if (options instanceof Specification) {
          Severity: Minor
          Found in src/specification.js - About 1 hr 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 _processHeaderSet has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              _processHeaderSet(now) {
                  let include = true;
          
                  if (this.minTimestamp) {
                      if (now < this.minTimestamp) {
          Severity: Minor
          Found in src/header-set-consolidator.js - About 1 hr 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 generateEmSimulatorSensorResponse has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          async function generateEmSimulatorSensorResponse(requestParams, requestBody) {
              let { subAddress, sensorNr, sensorType } = requestParams;
          
              if (isNumberString(subAddress)) {
                  subAddress = +subAddress;
          Severity: Minor
          Found in examples/json-live-data-server/index.js - About 1 hr to fix

            Function convertMenuXmlFile has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const convertMenuXmlFile = async function(inputFilename, outputFilename, convert) {
                inputFilename = path.resolve(__dirname, 'rpt-files', inputFilename);
                outputFilename = path.resolve(__dirname, '../../src/configuration-optimizers', outputFilename);
            
                console.log(outputFilename);
            Severity: Minor
            Found in tools/configuration-importer/index.js - About 1 hr to fix

              Function _filterProperties has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _filterProperties(parent, iterator) {
                      const _this = this;
              
                      const originalStack = _.clone(this.stack);
              
              
              Severity: Minor
              Found in tools/configuration-importer/xml-deserializer.js - About 1 hr to fix

                Function _processRecordForTopologyScan has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    _processRecordForTopologyScan(buffer) {
                        const type = buffer [1] & 0x0F;
                
                        let destinationAddress = 0, sourceAddress = 0, protocolVersion = 0, command = 0, hasHeader = false;
                        if (((type === 3) || (type === 6)) && (buffer.length >= 20)) {
                Severity: Minor
                Found in src/vbus-recording-converter.js - About 1 hr to fix

                  Function _convertVolumeFlowRawValue has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      _convertVolumeFlowRawValue(rawValue, sourceUnitCode, targetUnitCode) {
                          switch (sourceUnitCode) {
                          case 'LitersPerHour':
                              // nop
                              break;
                  Severity: Minor
                  Found in src/specification.js - About 1 hr to fix

                    Function onHeaderSet has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        const onHeaderSet = async (headerSet) => {
                            const headers = headerSet.getSortedHeaders();
                            const packetFields = specification.getPacketFieldsForHeaders(headers);
                    
                            const valuesById = packetFields.reduce((memo, pf) => {
                    Severity: Minor
                    Found in examples/vbustouch-proxy/index.js - About 1 hr to fix

                      Function _optimizeConfiguration has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          _optimizeConfiguration(config, adjustableValues) {
                              const configValueById = config.reduce((memo, configValue) => {
                                  memo [configValue.valueId] = configValue;
                                  return memo;
                              }, {});
                      Severity: Minor
                      Found in src/base-configuration-optimizer.js - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language