danielwippermann/resol-vbus

View on GitHub

Showing 212 of 557 total issues

Function getValueIdByIdHash has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    getValueIdByIdHash(address, valueIdHash, options) {
        const _this = this;

        options = applyDefaultOptions({}, options, {
            timeout: 500,
Severity: Minor
Found in src/connection.js - About 35 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 _createUInt8BlockTypeFieldSpecification has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    _createUInt8BlockTypeFieldSpecification(fieldIdPrefix, offset, name, typeId, factor) {
        return {
            fieldId: sprintf('%s_%03d_1_0', fieldIdPrefix, offset),
            name,
            type: this.getTypeById(typeId),
Severity: Minor
Found in src/specification.js - About 35 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 loadSpecificationData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    static loadSpecificationData(rawSpecificationData, options) {
        if (rawSpecificationData === undefined) {
            rawSpecificationData = {};
        }
        if (options === undefined) {
Severity: Minor
Found in src/specification.js - About 35 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 disconnect has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    disconnect() {
        if (this.connectionState === TcpConnection.STATE_DISCONNECTING) {
            if (this.socket) {
                this.socket.destroy();

Severity: Minor
Found in src/tcp-connection.js - About 35 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 $ 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 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 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 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 _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