Showing 1,213 of 1,213 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
(c = a(b.target).hasClass('active-result')
? a(b.target)
: a(b.target)
.parents('.active-result')
.first()),
- 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 58.
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 2 locations. Consider refactoring. Open
: ((this.search_container = this.container
.find('div.chosen-search')
.first()),
(this.selected_item = this.container
.find('.chosen-single')
- 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 58.
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 2 locations. Consider refactoring. Open
(c = a(b.target).hasClass('active-result')
? a(b.target)
: a(b.target)
.parents('.active-result')
.first()),
- 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 58.
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 initMap
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
zoom,
lat,
lng,
iso,
maptype,
Function _toggleLayer
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
_toggleLayer: function(event) {
event && event.preventDefault();
// this prevents layer change when you click in source link
if (
!$(event.target).hasClass('source') &&
Function handleStepEnter
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleStepEnter: function(data) {
var step = parseInt(data.element.dataset.step, 10);
if (this.currentStep !== step) {
var scene = 'init';
switch (step) {
Function filterCanvasImgdata
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
filterCanvasImgdata: function(imgdata, w, h, z) {
var components = 4;
var exp = z < 11 ? 0.3 + (z - 3) / 20 : 1;
if (!!!this.currentDate[0]._d) {
this.currentDate[0] = moment(this.currentDate[0]);
Function _setCurrentTooltip
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
_setCurrentTooltip: function(value) {
var currentStep = value || this.currentStep;
var current = d3.select('svg .dot-' + currentStep);
d3.selectAll('svg .dot').classed('hovered', false);
Function _drawCanvasImage
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
_drawCanvasImage: function(canvasData) {
'use asm';
var canvas = canvasData.canvas,
ctx = canvas.getContext('2d'),
image = canvasData.image,
Function onDownloadClick
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
onDownloadClick: function(e) {
e.preventDefault();
var downloadUrl = '/api/data_portal_downloads'; // TODO: move this to .env
var query = '';
var firstParam = true;
Function searchCountries
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
searchCountries: function(e) {
// TODO: move this to the presenter
var searchText = this.$searchBox.val();
var val = $.trim(searchText)
.replace(/ +/g, ' ')
Function _onBrush
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
_onBrush: function(event) {
var value = this.xscale.invert(d3.mouse(event)[0]);
var rounded = Math.round(value);
var x = this.xscale(rounded);
var date = this._domainToDate(rounded);
Function initialize
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
initialize: function() {
this.presenter = new Presenter(this);
this.layerInst = {};
this.$maplngLng = $('.map-container .map-latlng');
this.$viewFinder = $('#viewfinder');
Function _parseData
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
_parseData: function() {
this.chartData = [];
for (var indicator in this.data) {
var current = this.data[indicator];
Function _createScales
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
StackedChart.prototype._createScales = function() {
var self = this;
this.xKey = this.options.keys.x;
this.yKey = this.options.keys.y;
Function _drawTooltip
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
StackedChart.prototype._drawTooltip = function() {
var self = this;
var data = data;
// Tooltip
Function _onPlaceGo
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
_onPlaceGo: function(params) {
if (!!params.compare1 && !!params.compare2) {
// Fetching data
var complete = _.invoke(
[
Function setListeners
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
StackedChart.prototype.setListeners = function() {
var formatDate = d3.time.format('%Y');
var bisectDate = d3.bisector(function(d) {
return d.year;
}).left;
Identical blocks of code found in 3 locations. Consider refactoring. Open
init: function(router) {
this.router = router;
this._presenters = [];
this._name = null;
this._super();
- 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 57.
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
barGroup
.append('rect')
.attr('class', function(d) {
return 'bar ' + d.type;
})
- 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 57.
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