File highcharts-more.src.js
has 1795 lines of code (exceeds 250 allowed). Consider refactoring. Open
// ==ClosureCompiler==
// @compilation_level SIMPLE_OPTIMIZATIONS
/**
* @license Highcharts JS v4.1.9 (2015-10-07)
Function drawPoints
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
drawPoints: function () {
var series = this, //state = series.state,
points = series.points,
options = series.options,
chart = series.chart,
Function beforePadding
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Axis.prototype.beforePadding = function () {
var axis = this,
axisLength = this.len,
chart = this.chart,
pxMin = 0,
Function translate
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
translate: function () {
var series = this,
options = series.options,
yAxis = series.yAxis,
len,
Function drawDataLabels
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
drawDataLabels: function () {
var data = this.data,
length = data.length,
i,
Function getPlotBandPath
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
getPlotBandPath: function (from, to, options) {
var center = this.center,
startAngleRad = this.startAngleRad,
fullRadius = center[2] / 2,
radii = [
Function translate
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
translate: function () {
var series = this,
yAxis = series.yAxis,
options = series.options,
Function polarAnimate
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function polarAnimate(proceed, init) {
var chart = this.chart,
animation = this.options.animation,
group = this.group,
markerGroup = this.markerGroup,
Function drawPoints
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
drawPoints: function () {
var series = this,
center = series.yAxis.center,
pivot = series.pivot,
Function getSegmentPath
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
getSegmentPath: function (segment) {
var lowSegment,
highSegment = [],
i = segment.length,
Function getPlotLinePath
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
getPlotLinePath: function (value, reverse) {
var axis = this,
center = axis.center,
chart = axis.chart,
end = axis.getPosition(value),
Consider simplifying this complex logical expression. Open
if (point.plotY !== UNDEFINED) {
pointAttr = point.pointAttr[point.selected ? 'selected' : ''];
// crisp vector coordinates
Function getRadii
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
getRadii: function (zMin, zMax, minSize, maxSize) {
var len,
i,
pos,
zData = this.zData,
Function processData
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
processData: function (force) {
var series = this,
options = series.options,
yData = series.yData,
points = series.options.data, // #3710 Update point does not propagate to sum
Function translate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
translate: function () {
var i,
data = this.data,
point,
Function getGraphPath
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
getGraphPath: function () {
var data = this.data,
length = data.length,
lineWidth = this.options.lineWidth + this.borderWidth,
Function translate
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
translate: function () {
var series = this,
yAxis = series.yAxis,
plotHigh;
Avoid deeply nested control flow statements. Open
if (!align) {
dataLabelOptions.align = up ? 'right' : 'left';
}
Avoid deeply nested control flow statements. Open
if (!align) {
dataLabelOptions.align = up ? 'left' : 'right';
}
TODO found Open
// TODO: Implement true handling of Y axis categories on gauges.
- Exclude checks
Identical blocks of code found in 2 locations. Consider refactoring. Open
(function (Highcharts, UNDEFINED) {
var arrayMin = Highcharts.arrayMin,
arrayMax = Highcharts.arrayMax,
each = Highcharts.each,
extend = Highcharts.extend,
- 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 17935.
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