Showing 332 of 436 total issues
Function initContainer
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
initContainer: function () {
var selector = ".select2-choices", selection;
this.searchContainer = this.container.find(".select2-search-field");
Function render
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function () {
var chart = this,
axes = chart.axes,
renderer = chart.renderer,
options = chart.options;
Consider simplifying this complex logical expression. Open
if (
// already has this state
state === point.state ||
// selected points don't respond to hover
(point.selected && state !== SELECT_STATE) ||
Consider simplifying this complex logical expression. Open
if (optionsLabel && defined(optionsLabel.text) && path && path.length && axis.width > 0 && axis.height > 0) {
// apply defaults
optionsLabel = merge({
align: horiz && isBand && 'center',
x: horiz ? !isBand && 4 : 10,
Function Color
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Color = function (input) {
// declare variables
var rgba = [], result, stops;
/**
Function getTimeTicks
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getTimeTicks(normalizedInterval, min, max, startOfWeek) {
var tickPositions = [],
i,
higherRanks = {},
useUTC = defaultOptions.global.useUTC,
Function getMargins
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
getMargins: function () {
var chart = this,
spacing = chart.spacing,
axisOffset,
legend = chart.legend,
Function clipNeg
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
clipNeg: function () {
var options = this.options,
chart = this.chart,
renderer = chart.renderer,
negativeColor = options.negativeColor || options.negativeFillColor,
Method generate_report_table
has 71 lines of code (exceeds 25 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 = []
Function getLogTickPositions
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
getLogTickPositions: function (interval, min, max, minor) {
var axis = this,
options = axis.options,
axisLength = axis.len,
// Since we use this method for both major and minor ticks,
Function addPoint
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
addPoint: function (options, redraw, shift, animation) {
var series = this,
seriesOptions = series.options,
data = series.data,
graph = series.graph,
Function addLabel
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
addLabel: function () {
var tick = this,
axis = tick.axis,
options = axis.options,
chart = axis.chart,
Method graph_values
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def graph_values(current_user)
categories = []
values = self.all_values_for_column(current_user)[:values]
case self.variable.variable_type when 'numeric', 'integer'
- 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 init
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function (opts) {
var results, search, resultsSelector = ".select2-results";
// prepare options
this.opts = opts = this.prepareOpts(opts);
Function setState
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
setState: function (state) {
var point = this,
plotX = point.plotX,
plotY = point.plotY,
series = point.series,
Function sparkline
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.sparkline = function (userValues, userOptions) {
return this.each(function () {
var options = new $.fn.sparkline.options(this, userOptions),
$this = $(this),
render, i;
Function updateResults
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateResults: function (initial) {
var search = this.search, results = this.results, opts = this.opts, data, self=this, input;
// if the search is currently hidden we do not alter the results
if (initial !== true && (this.showSearchInput === false || !this.opened())) {
Method import_variables
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def import_variables(file_name)
version = Time.now.to_i.to_s
CSV.parse( File.open(file_name, 'r:iso-8859-1:utf-8'){|f| f.read}, headers: true ) do |line|
row = line.to_hash
- 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
Method update
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def update
@criterium = @search.criteria.find_by_id(params[:id])
if @criterium
params[:criterium] = {} if params[:criterium].blank?
params[:criterium][:right_operator] = 'and' unless Criterium::OPERATOR.include?(params[:criterium][:right_operator])
- 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 drag
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
drag: function (e) {
var chart = this.chart,
chartOptions = chart.options.chart,
chartX = e.chartX,