Showing 436 of 436 total issues
File highcharts-3.0.7.src.js
has 11199 lines of code (exceeds 250 allowed). Consider refactoring. Open
// ==ClosureCompiler==
// @compilation_level SIMPLE_OPTIMIZATIONS
/**
* @license Highcharts JS v3.0.7 (2013-10-24)
File jquery.sparkline.js
has 2441 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
*
* jquery.sparkline.js
*
* v2.1.1
File select2.js
has 1712 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
Copyright 2012 Igor Vaynberg
Version: 3.2 Timestamp: Mon Sep 10 10:38:04 PDT 2012
Method finalize_report_table
has a Cognitive Complexity of 153 (exceeds 5 allowed). Consider refactoring. Open
def finalize_report_table(current_user, include_html = true)
result_hash = self.generate_report_table(current_user)
values = result_hash[:values]
- 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 TokenList
has 480 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.TokenList = function (input, url_or_data, settings) {
//
// Initialization
//
File jquery.tokeninput.js
has 590 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* jQuery Plugin: Tokenizing Autocomplete Text Entry
* Version 1.5.0
*
* Copyright (c) 2009 James Smith (http://loopj.com)
Method generate_report_table
has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring. Open
def generate_report_table(current_user)
filtered_report_concepts = self.report_concepts.select{|rc| not rc.position.blank?}
values = self.search.view_concept_values(current_user, filtered_report_concepts)
row_values = []
- 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 drawDataLabels
has 201 lines of code (exceeds 25 allowed). Consider refactoring. Open
drawDataLabels: function () {
var series = this,
data = series.data,
point,
chart = series.chart,
Function label
has 198 lines of code (exceeds 25 allowed). Consider refactoring. Open
label: function (str, x, y, shape, anchorX, anchorY, useHTML, baseline, className) {
var renderer = this,
wrapper = renderer.g(className),
text = renderer.text('', 0, 0, useHTML)
Function attr
has 164 lines of code (exceeds 25 allowed). Consider refactoring. Open
attr: function (hash, val) {
var wrapper = this,
key,
value,
result,
Function render
has 159 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function () {
var options = this.options,
target = this.target,
canvasWidth = this.canvasWidth,
canvasHeight = this.canvasHeight,
Function render
has 155 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function () {
var axis = this,
chart = axis.chart,
renderer = chart.renderer,
options = axis.options,
Method generate_sql_as_normal
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
def generate_sql_as_normal(thesource)
result = "1 = 0"
result_hash = thesource.sql_codes(current_user)
sql_text = result_hash[:text]
- 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 setTickPositions
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
setTickPositions: function (secondPass) {
var axis = this,
chart = axis.chart,
options = axis.options,
isLog = axis.isLog,
Function attr
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
attr: function (hash, val) {
var wrapper = this,
key,
value,
i,
Function getOffset
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
getOffset: function () {
var axis = this,
chart = axis.chart,
renderer = chart.renderer,
options = axis.options,
Function render
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function () {
var target = this.target,
values = this.values,
vlen = values.length,
options = this.options,
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (spotRadius && options.get('minSpotColor')) {
x = xvalues[$.inArray(this.minyorg, yvalues)];
target.drawCircle(canvasLeft + Math.round((x - this.minx) * (canvasWidth / rangex)),
canvasTop + Math.round(canvasHeight - (canvasHeight * ((this.minyorg - this.miny) / rangey))),
spotRadius, undefined,
- 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 137.
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 (spotRadius && options.get('maxSpotColor')) {
x = xvalues[$.inArray(this.maxyorg, yvalues)];
target.drawCircle(canvasLeft + Math.round((x - this.minx) * (canvasWidth / rangex)),
canvasTop + Math.round(canvasHeight - (canvasHeight * ((this.maxyorg - this.miny) / rangey))),
spotRadius, undefined,
- 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 137.
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 buildText
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildText: function (wrapper) {
var textNode = wrapper.element,
renderer = this,
forExport = renderer.forExport,
lines = pick(wrapper.textStr, '').toString()