Showing 540 of 540 total issues
Identical blocks of code found in 2 locations. Consider refactoring. Open
buttons.on("click", function() {
d3.event.preventDefault();
d3.event.stopPropagation();
- 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 81.
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
buttons.on("click", function() {
d3.event.preventDefault();
d3.event.stopPropagation();
- 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 81.
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
File show.js
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as utils from "base/utils";
import Component from "base/component";
/*!
* VIZABI SHOW PANEL CONTROL
Function getQuery
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
getQuery(splashScreen) {
let filters;
//error if there's nothing to hook to
if (Object.keys(this._space).length < 1) {
Function firstBy
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export function firstBy() {
function identity(v) {
return v;
}
- 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 updateLabel
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
updateLabel(d, index, cache, valueX, valueY, valueS, valueC, valueL, valueLST, duration, showhide) {
const _this = this;
const KEYS = this.KEYS;
const KEY = this.KEY;
if (d[KEY] == _this.dragging)
- 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 ajax
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export const ajax = function(options) {
const request = new XMLHttpRequest();
request.open(options.method, options.url, true);
if (options.method === "POST" && !options.json) {
request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
- 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 setWidth
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
setWidth(width, recursive, immediate) {
if (this.width != width && this.entity.node()) {
this.width = width;
if ((this.entity.classed(css.list_top_level) || this.entity.classed("active")) && this.direction == MENU_HORIZONTAL) {
if (!immediate) {
- 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 init
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
init(config, parent) {
this.name = "find";
const _this = this;
this.components = [{
- 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 splitEventParameters
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
splitEventParameters(type, path, func, eventFunc) {
let i;
const calls = [];
// multiple at a time, array format: [{type: function}, {'type:path': function}, ... ]
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
"change:time.end": function(evt, original) {
if (!_this._readyOnce || _this.model.time.splash) return;
if (_this.colorModel.which == _this.model.time.dim) {
_this.ready();
}
- 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 80.
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
"change:time.start": function(evt, original) {
if (!_this._readyOnce || _this.model.time.splash) return;
if (_this.colorModel.which == _this.model.time.dim) {
_this.ready();
}
- 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 80.
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 readyOnce
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
readyOnce() {
const version = globals.version;
const updated = new Date(parseInt(globals.build));
this.element = d3.select(this.element);
Function update
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
update() {
const _this = this;
const margin = this.model.show.toolMargin.getPlainObject();
Function start
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
.on("start", function start(d, i) {
//click сompatible node raise
let nextSibling = this.nextSibling;
while (nextSibling) {
this.parentNode.insertBefore(nextSibling, this);
Function aggregateData
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
aggregateData(dataId, query, readerObject, conceptProps) {
if (Object.keys(query.grouping).every(key => query.grouping[key]["grouping"] === 1)) {
return Promise.resolve(dataId);
}
EntitiesModel
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
const EntitiesModel = DataConnected.extend({
/**
* Default values for this model
*/
Function readyOnce
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
readyOnce() {
this._super();
this.panelComps = { find: this, show: this.findChildByName("show") };
File find.js
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as utils from "base/utils";
import Dialog from "components/dialogs/_dialog";
import show from "./show";
import singlehandleslider from "components/brushslider/singlehandleslider/singlehandleslider";
Function getBrowserDetails
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export const getBrowserDetails = () => {
const nVer = navigator.appVersion;
const nAgt = navigator.userAgent;
let browserName = navigator.appName;
- 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"