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);
Function plot
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
plot: function() {
$('#test-content').highcharts({
chart: {
type: 'scatter'
},
Function start
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
start() {
//Store the current heading
this.startHeading = SlacJsData.motion[0].heading;
Function _initErrorPlot
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
_initErrorPlot() {
this.errorPlot = {
data: [],
Function updateScaleFactor
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateScaleFactor(user, landmarks) {
let maxX = 0;
let maxY = 0;
Function save
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
save(data) {
data = 'SlacJsData = ' + JSON.stringify(data) + ';';
/*
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);
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;
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';
Function processObservation
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
processObservation(obs) {
if (obs !== {}) {
const { uid, r, name, moved } = obs;
- Read upRead up
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);
- Read upRead up
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};
}
- Read upRead up
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 = [];
- Read upRead up
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;
- Read upRead up
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;
- Read upRead up
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;
- Read upRead up
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"