Showing 540 of 540 total issues
Function axisSmart
has a Cognitive Complexity of 582 (exceeds 5 allowed). Consider refactoring. Open
export default function axisSmart(_orient) {
return (function d3_axis_smart(_super) {
const VERTICAL = "vertical axis";
- 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
File treemenu.js
has 1273 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as utils from "base/utils";
import Component from "base/component";
import Class from "base/class";
import Hook from "models/hook";
import Marker from "models/marker";
Function axisSmart
has 644 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function axisSmart(_orient) {
return (function d3_axis_smart(_super) {
const VERTICAL = "vertical axis";
Function d3_axis_smart
has 642 lines of code (exceeds 25 allowed). Consider refactoring. Open
return (function d3_axis_smart(_super) {
const VERTICAL = "vertical axis";
const HORIZONTAL = "horizontal axis";
const X = "labels stack side by side";
File utils.js
has 1070 lines of code (exceeds 250 allowed). Consider refactoring. Open
import interpolator from "vizabi-interpolators/interpolators";
export const d3json = function(path, callback) {
d3.json(path)
Function _updateRainbowLegend
has a Cognitive Complexity of 93 (exceeds 5 allowed). Consider refactoring. Open
_updateRainbowLegend(isVisible) {
const _this = this;
//Hide rainbow element if showing minimap or if color is discrete
this.rainbowEl.classed("vzb-hidden", !isVisible);
- 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 label
has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring. Open
const label = function(context) {
return (function d3_label() {
const _this = context;
- 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
File labels.js
has 722 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as utils from "base/utils";
import Class from "base/class";
import cssEscape from "css.escape";
import { close as iconClose } from "base/iconset";
File marker.js
has 694 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as utils from "base/utils";
import Model from "base/model";
/*!
* HOOK MODEL
Function collisionResolver
has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring. Open
export default function collisionResolver() {
return (function collision_resolver() {
const DURATION = 300;
let labelHeight = 0;
// MAINN FUNCTION. RUN COLLISION RESOLVER ON A GROUP g
- 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
File d3.axisWithLabelPicker.js
has 647 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as utils from "base/utils";
//d3.axisSmart
export default function axisSmart(_orient) {
Function resize
has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring. Open
resize() {
const _this = this;
this.profiles = {
"small": {
- 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 labelFactory
has 275 lines of code (exceeds 25 allowed). Consider refactoring. Open
axis.labelFactory = function(options) {
if (options == null) options = {};
if (options.scaleType != "linear" &&
options.scaleType != "time" &&
options.scaleType != "genericLog" &&
File datastorage.js
has 621 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as utils from "base/utils";
import Class from "base/class";
function _getQueryId(query, path, lastModified, readerName) {
File colorlegend.js
has 601 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as utils from "base/utils";
import Component from "base/component";
import ColorPicker from "helpers/d3.colorPicker";
import axisSmart from "helpers/d3.axisWithLabelPicker";
import { close as iconClose } from "base/iconset";
Function label
has 249 lines of code (exceeds 25 allowed). Consider refactoring. Open
const label = function(context) {
return (function d3_label() {
const _this = context;
Function d3_label
has 247 lines of code (exceeds 25 allowed). Consider refactoring. Open
return (function d3_label() {
const _this = context;
let _cssPrefix;
Similar blocks of code found in 2 locations. Consider refactoring. Open
updateSelectedStartLimiter() {
const _this = this;
this.select.select("#clip-start-" + _this._id).remove();
this.select.select(".selected-start").remove();
if (this.model.time.startSelected && this.model.time.startSelected > this.model.time.start) {
- 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 225.
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
updateSelectedEndLimiter() {
const _this = this;
this.select.select("#clip-end-" + _this._id).remove();
this.select.select(".selected-end").remove();
if (this.model.time.endSelected && this.model.time.endSelected < this.model.time.end) {
- 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 225.
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 timeslider.js
has 554 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as utils from "base/utils";
import Component from "base/component";
import axisSmart from "helpers/d3.axisWithLabelPicker";
const precision = 1;