Showing 1,213 of 1,213 total issues
Function display_by_ny
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
(BubbleChart.prototype.display_by_ny = function() {
this.force
.gravity(this.layout_gravity)
.charge(this.charge)
.friction(0.9)
Function display_by_ny
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
(BubbleChart.prototype.display_by_ny = function() {
this.force
.gravity(this.layout_gravity)
.charge(this.charge)
.friction(0.9)
Function welcome
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
welcome: function() {
console.info(
'%c .',
"background-image: url('http://www.globalforestwatch.org/assets/logo-new.png'); width: 85px; height: 90px; float:left;font-size:82px; color: transparent;"
);
Function _renderLegend
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
_renderLegend: function(el, data, filter) {
var current = _.filter(data, function(d) {
return (d.week * 1) === this.currentStep;
}.bind(this))[0];
Function _getLayerData
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
_getLayerData: function(layer, opts) {
var unitsList = [];
var selectedUnit =
!!opts.rangearray && opts.rangearray[layer.slug]
? opts.rangearray[layer.slug].unit
Function display_group_all
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
BubbleChart.prototype.display_group_all = function() {
this.force
.gravity(this.layout_gravity)
.charge(this.charge)
.friction(0.9)
Function _drawAxis
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
_drawAxis: function() {
var _this = this;
// X Axis
var xAxis = this.svg
Function display_group_all
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
BubbleChart.prototype.display_group_all = function() {
this.force
.gravity(this.layout_gravity)
.charge(this.charge)
.friction(0.9)
Function _setupGrid
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
_setupGrid: function() {
var promises = [],
widgetsArray = [];
_.map(
Identical blocks of code found in 2 locations. Consider refactoring. Open
this.y = d3.scale
.linear()
.range([
this.height - this.options.innerPadding.bottom,
this.options.innerPadding.top
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 67.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
mps.subscribe(
'LineChart/mousemove' + this.options.slug + this.options.id,
function(x0) {
if (!!self.svg) {
self.setTooltip(x0, true);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 67.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
this.y = d3.scale
.linear()
.range([
this.height - this.options.innerPadding.bottom,
this.options.innerPadding.top
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 67.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
mps.subscribe(
'LineChart/mousemove' + this.options.slug + this.options.id,
function(x0) {
if (!!self.svg) {
self.setTooltip(x0, true);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 67.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
mps.subscribe(
'StackedChart/mousemove' + this.options.slug + this.options.id,
function(x0) {
if (!!self.svg) {
self.setTooltip(x0, true);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 67.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function CustomTooltip
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function CustomTooltip(tooltipId, width) {
var tooltipId = tooltipId;
$('#vis').append("<div class='tooltip' id='" + tooltipId + "'></div>");
if (width) {
- 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 CustomTooltip
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function CustomTooltip(tooltipId, width) {
var tooltipId = tooltipId;
$('#vis').append("<div class='tooltip' id='" + tooltipId + "'></div>");
if (width) {
- 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 initialize
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
initialize: function(layer, currentDate) {
this.layer = layer;
this.name = layer.slug;
this.options = _.extend({}, this.defaults, this.options || {});
this.dateRangeStart = this.options.dateRange[0];
Function preCacheMonths
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
preCacheMonths: function(rows, coord, zoom, zoom_diff) {
var row, xcoords, ycoords, deforestation;
if (typeof ArrayBuffer !== 'undefined') {
xcoords = new Uint8Array(new ArrayBuffer(rows.length));
Function initialize
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
initialize: function(layer, currentDate) {
_.bindAll(this, '_onClickTick', '_selectDate');
this.layer = layer;
this.name = layer.slug;
Function parseData
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseData: function(widget) {
if (!widget)
return {
title: model.title,
subtitle: 'No data download available'