wouterbulten/slacjs

View on GitHub

Showing 16 of 44 total issues

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

    start() {

        console.log('[SLACjs] Starting');

        this.uiElements.btnStart.prop('disabled', true);
Severity: Minor
Found in src/app/app-mobile.js - About 1 hr to fix

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

        plot: function() {
            $('#test-content').highcharts({
                chart: {
                    type: 'scatter'
                },    
    Severity: Minor
    Found in src/tests/rssi-filter.js - About 1 hr to fix

      Function start has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          start() {
      
              //Store the current heading
              this.startHeading = SlacJsData.motion[0].heading;
      
      
      Severity: Minor
      Found in src/app/app-replay.js - About 1 hr to fix

        Function _initErrorPlot has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            _initErrorPlot() {
        
                this.errorPlot = {
        
                    data: [],
        Severity: Minor
        Found in src/app/app-replay.js - About 1 hr to fix

          Function updateScaleFactor has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              updateScaleFactor(user, landmarks) {
          
                  let maxX = 0;
                  let maxY = 0;
          
          
          Severity: Minor
          Found in src/app/view/particle-renderer.js - About 1 hr to fix

            Function save has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                save(data) {
            
                    data = 'SlacJsData =  ' + JSON.stringify(data) + ';';
            
                    /*
            Severity: Minor
            Found in src/app/device/data-storage.js - About 1 hr to fix

              Function _addLandmark has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _addLandmark(uid, name) {
              
                      const uiId = 'activity-' + uid;
                      const friendlyName = this._friendlyName(name);
              
              
              Severity: Minor
              Found in src/app/view/landmark-activity-panel.js - About 1 hr to fix

                Function _midpointCircle has 27 lines of code (exceeds 25 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 1 hr to fix

                  Function _draw has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      _draw: function() {
                  
                          this.ctx.clearRect (0, 0, this.canvas.width, this.canvas.height);
                          this.ctx.fillStyle = '#000000';
                  
                  
                  Severity: Minor
                  Found in src/tests/landmark-init.js - About 1 hr to fix

                    Function processObservation has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        processObservation(obs) {
                    
                            if (obs !== {}) {
                    
                                const { uid, r, name, moved } = obs;
                    Severity: Minor
                    Found in src/app/models/particle-set.js - About 55 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 exports has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    module.exports = function (gulp, entries, outputDir, includeTests) {
                        return function () {
                    
                            if(includeTests) {
                                entries = entries.concat(config.tests);
                    Severity: Minor
                    Found in tasks/transpile.js - About 45 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 positionEstimate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        positionEstimate() {
                            if (this.measurements < 3) {
                                return {estimate: 0, x: 0, y: 0};
                            }
                    
                    
                    Severity: Minor
                    Found in src/app/models/vote-accumulator.js - About 45 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 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