Showing 86 of 86 total issues
File rickshaw.js
has 1955 lines of code (exceeds 250 allowed). Consider refactoring. Open
var Rickshaw = {
namespace: function(namespace, obj) {
var parts = namespace.split('.');
Function ClassList
has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring. Open
Rickshaw.Compat.ClassList = function() {
/* adapted from http://purl.eligrey.com/github/classList.js/blob/master/classList.js */
if (typeof document !== "undefined" && !("classList" in document.createElement("a"))) {
- 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 Graph
has 159 lines of code (exceeds 25 allowed). Consider refactoring. Open
Rickshaw.Graph = function(args) {
this.element = args.element;
this.series = args.series;
Function Color
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
Rickshaw.Fixtures.Color = function() {
this.schemes = {};
this.schemes.spectrum14 = [
Similar blocks of code found in 2 locations. Consider refactoring. Open
else if (y >= 1099511627776){ return y / 1099511627776 + "T" }
else if (y >= 1073741824) { return y / 1073741824 + "G" }
else if (y >= 1048576) { return y / 1048576 + "M" }
else if (y >= 1024) { return y / 1024 + "K" }
else if (y < 1 && y > 0) { return y.toFixed(2) }
- 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 144.
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
if (y >= 1000000000000) { return y / 1000000000000 + "T" }
else if (y >= 1000000000) { return y / 1000000000 + "B" }
else if (y >= 1000000) { return y / 1000000 + "M" }
else if (y >= 1000) { return y / 1000 + "K" }
else if (y < 1 && y > 0) { return y.toFixed(2) }
- 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 144.
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 ClassList
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
Rickshaw.Compat.ClassList = function() {
/* adapted from http://purl.eligrey.com/github/classList.js/blob/master/classList.js */
if (typeof document !== "undefined" && !("classList" in document.createElement("a"))) {
Function Graph
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
Rickshaw.Graph = function(args) {
this.element = args.element;
this.series = args.series;
- 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 Toggle
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
Rickshaw.Graph.Behavior.Series.Toggle = function(args) {
this.graph = args.graph;
this.legend = args.legend;
- 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
Identical blocks of code found in 2 locations. Consider refactoring. Open
return d3.svg.area()
.x( function(d) { return graph.x(d.x) } )
.y0( function(d) { return graph.y(d.y0) } )
.y1( function(d) { return graph.y(d.y + d.y0) } )
.interpolate(this.graph.interpolation).tension(this.tension);
- 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 112.
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
return d3.svg.area()
.x( function(d) { return graph.x(d.x) } )
.y0( function(d) { return graph.y(d.y0) } )
.y1( function(d) { return graph.y(d.y + d.y0) } )
.interpolate(graph.interpolation).tension(this.tension);
- 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 112.
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 Time
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
Rickshaw.Fixtures.Time = function() {
var tzOffset = new Date().getTimezoneOffset() * 60;
var self = this;
Function Toggle
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Rickshaw.Graph.Behavior.Series.Toggle = function(args) {
this.graph = args.graph;
this.legend = args.legend;
Function Annotate
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Rickshaw.Graph.Annotate = function(args) {
var graph = this.graph = args.graph;
this.elements = { timeline: args.element };
Method build_mongo_conditions
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def build_mongo_conditions
@mongo_conditions = Hash.new
FIXED_PARAMS_ON_FORM.each do |param_key|
value = self.send param_key
mkey_val = case param_key
- 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 Y
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Rickshaw.Graph.Axis.Y = function(args) {
var self = this;
var berthRate = 0.10;
Function Y
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Rickshaw.Graph.Axis.Y = function(args) {
var self = this;
var berthRate = 0.10;
- 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 Class
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Class = (function() {
// Some versions of JScript fail to enumerate over properties, names of which
// correspond to non-enumerable properties in the prototype chain
var IS_DONTENUM_BUGGY = (function(){
Function update
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.update = function() {
Rickshaw.keys(self.data).forEach( function(time) {
var annotation = self.data[time];
Class Logger
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Logger < RailsLogger
include ReplicaSetHelper
DEFAULT_COLLECTION_SIZE = 250.megabytes
# Looks for configuration files in this order