wouterbulten/slacjs

View on GitHub

Showing 44 of 44 total issues

Function rouletteWheelSampling has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function rouletteWheelSampling(nSamples, weights) {

    const stackedWeights = weightedCumulativeSum(weights);
    const set = [];

Severity: Minor
Found in src/app/util/sampling.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 walkPattern has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function* walkPattern() {
    const steps = 16;
    const stepSize = 5;
    const quarter = steps / 4;

Severity: Minor
Found in src/tests/landmark-init.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 _midpointCircle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    _midpointCircle(row, column, r) {

        let x = r;
        let y = 0;
        let radiusError = 1 - x;
Severity: Minor
Found in src/app/models/vote-accumulator.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 addObservation has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    addObservation(uid, rssi, name) {

        //Check whether the rssi value is valid
        if(rssi > 0) {
            return;
Severity: Minor
Found in src/app/models/sensor.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