Showing 332 of 436 total issues
Function init
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init: function (el, values, options, width, height) {
var barWidth = parseInt(options.get('barWidth'), 10),
barSpacing = parseInt(options.get('barSpacing'), 10),
chartRangeMin = options.get('chartRangeMin'),
chartRangeMax = options.get('chartRangeMax'),
Function initContainer
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
initContainer: function () {
var selection,
container = this.container,
dropdown = this.dropdown,
Function prepareOpts
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
prepareOpts: function (opts) {
var element, select, idKey, ajaxUrl;
element = opts.element;
Function renderItem
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderItem: function (item) {
var legend = this,
chart = legend.chart,
renderer = chart.renderer,
options = legend.options,
Function refresh
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
refresh: function (point, mouseEvent) {
var tooltip = this,
chart = tooltip.chart,
label = tooltip.label,
options = tooltip.options,
Function render
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render: function (index, old, opacity) {
var tick = this,
axis = tick.axis,
options = axis.options,
chart = axis.chart,
Function redraw
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
redraw: function (animation) {
var chart = this,
axes = chart.axes,
series = chart.series,
pointer = chart.pointer,
Method finalize_report_table
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def finalize_report_table(current_user, include_html = true)
result_hash = self.generate_report_table(current_user)
values = result_hash[:values]
Method set_values
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
Open
def set_values
all_sources.each do |source|
wrapper = Aqueduct::Builder.wrapper(source, @current_user)
mappings_for_select_clause = []
- 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 render
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render: function () {
var legend = this,
chart = legend.chart,
renderer = chart.renderer,
legendGroup = legend.group,
Function button
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
button: function (text, x, y, callback, normalState, hoverState, pressedState, disabledState, shape) {
var label = this.label(text, x, y, shape, null, null, null, null, 'button'),
curState = 0,
stateOptions,
stateStyle,
Function init
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init: function (pathAnim) {
// extend the animate function to allow SVG animations
var Fx = $.fx,
Step = Fx.step,
Function drawDataLabels
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
drawDataLabels: function () {
var series = this,
seriesOptions = series.options,
cursor = seriesOptions.cursor,
Function htmlUpdateTransform
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
htmlUpdateTransform: function () {
// aligning non added elements is expensive
if (!this.added) {
this.alignOnAdd = true;
return;
Function drawChartBox
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
drawChartBox: function () {
var chart = this,
optionsChart = chart.options.chart,
renderer = chart.renderer,
chartWidth = chart.chartWidth,
Function setData
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setData: function (data, redraw) {
var series = this,
oldData = series.points,
options = series.options,
chart = series.chart,
Function color
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
color: function (color, elem, prop) {
var renderer = this,
colorObject,
regexRgba = /^rgba/,
gradName,
Function getAttribs
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getAttribs: function () {
var series = this,
seriesOptions = series.options,
normalOptions = defaultPlotOptions[series.type].marker ? seriesOptions.marker : seriesOptions,
stateOptions = normalOptions.states,
Function html
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
html: function (str, x, y) {
var defaultChartStyle = defaultOptions.chart.style,
wrapper = this.createElement('span'),
attrSetters = wrapper.attrSetters,
element = wrapper.element,
Function translate
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
translate: function (positions) {
this.generatePoints();
var series = this,
cumulative = 0,