sentilo/sentilo

View on GitHub

Showing 627 of 1,220 total issues

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

var refreshChartControlLabels = function(theNavData) {
    
    // This is a chart callback function
    // When data is loaded onto chart, calls this function
    // for update window labels
Severity: Minor
Found in sentilo-catalog-web/src/main/webapp/static/js/sentilo/sensor_data.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 buildCanvas has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

var buildCanvas=function(host, artefact, metricname,time){
    var name = host +"-"+ artefact;  
    var element="";
    for(var chart in charts){  
         if($(jqEscape(name+"_chart_"+charts[chart])).length==0){ 
Severity: Minor
Found in sentilo-catalog-web/src/main/webapp/static/js/sentilo/metrics.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 retrieveChartPanel has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

var retrieveChartPanel = function() {
    
    var url = createChartUrl(lastObsUrl);
    var placeholder = "#plot";
    var valuePlaceholder = '#sensorLastObsValue';
Severity: Minor
Found in sentilo-catalog-web/src/main/webapp/static/js/sentilo/sensor_data.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 getData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

var getData = function() {
    
    for (var c in chartNames){ 
    var newTime=addTimeValue(chartNames[c]);
    if(newTime != window.chartNames[c].data.labels[window.chartNames[c].data.labels.length -1]){
Severity: Minor
Found in sentilo-catalog-web/src/main/webapp/static/js/sentilo/metrics.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 MarkerClusterer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function MarkerClusterer(map, opt_markers, opt_options) {
  // MarkerClusterer implements google.maps.OverlayView interface. We use the
  // extend function to extend MarkerClusterer with google.maps.OverlayView
  // because it might not always be available when the code is defined so we
  // look for it at the last possible moment. If it doesn't exist now then
Severity: Minor
Found in sentilo-catalog-web/src/main/webapp/static/js/markerclusterer.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 retrieveActivity has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

var retrieveActivity = function(placeholder, url, label) {
    if (selectedSensor.dataType === 'LINK' || 
        selectedSensor.dataType === 'AUDIO_LINK' || 
        selectedSensor.dataType === 'IMAGE_LINK' || 
        selectedSensor.dataType === 'VIDEO_LINK' || 

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 showLastObservations has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function showLastObservations(componentId, sensorId, panel) {

    var sensor = sensorsLastObsMap[sensorId];

    if (!sensor || sensor === null || sensor === undefined) {
Severity: Minor
Found in sentilo-catalog-web/src/main/webapp/static/js/sentilo/universal_map.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