Showing 544 of 841 total issues
Function exports
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(Chart) {
var helpers = Chart.helpers;
// Default config for a category scale
var defaultConfig = {
Function exports
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(Chart) {
var helpers = Chart.helpers;
Chart.defaults.global.plugins = {};
Method process_vars
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
Open
def process_vars(statement, data_source)
(@bind_vars ||= []).concat(Blazer.extract_vars(statement)).uniq!
@bind_vars.each do |var|
params[var] ||= Blazer.data_sources[data_source].variable_defaults[var]
end
- 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 enter
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function enter (vnode) {
var el = vnode.elm;
// call leave callback now
if (el._leaveCb) {
Function Animation
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Animation( elem, properties, options ) {
var result,
stopped,
index = 0,
length = animationPrefilters.length,
Function 37
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{}],37:[function(require,module,exports){
'use strict';
module.exports = function(Chart) {
Consider simplifying this complex logical expression. Open
Open
if (!GoogleChartsAdapter && window.google && (window.google.setOnLoadCallback || window.google.charts)) {
GoogleChartsAdapter = new function () {
var google = window.google;
this.name = "google";
Function getParseRegexForToken
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getParseRegexForToken(token, config) {
var a, strict = config._strict;
switch (token) {
case 'Q':
return parseTokenOneDigit;
Function 39
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{}],39:[function(require,module,exports){
'use strict';
module.exports = function(Chart) {
Function exports
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(Chart) {
var helpers = Chart.helpers,
globalOpts = Chart.defaults.global;
Method detect_anomaly
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
Open
def detect_anomaly
anomaly = nil
message = nil
if rows.empty?
- 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
File jquery_ujs.js
has 302 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
(function($, undefined) {
/**
* Unobtrusive scripting adapter for jQuery
* https://github.com/rails/jquery-ujs
Function exports
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(Chart) {
var helpers = Chart.helpers,
globalOpts = Chart.defaults.global,
defaultColor = globalOpts.defaultColor;
Function createChart
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createChart(chartType, chart, element, dataSource, opts, processData) {
var elementId;
if (typeof element === "string") {
elementId = element;
element = document.getElementById(element);
Function Sizzle
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Sizzle( selector, context, results, seed ) {
var match, elem, m, nodeType,
// QSA vars
i, groups, old, nid, newContext, newSelector;
Function fit
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fit: function() {
var me = this;
var opts = me.options;
var labelOpts = opts.labels;
var display = opts.display;
Function onKeyDown
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
onKeyDown: function(e) {
var isInput = e.target === this.$control_input[0];
var self = this;
if (self.isLocked) {
Consider simplifying this complex logical expression. Open
Open
if (circumference < Math.PI * 2.0) {
var startAngle = opts.rotation % (Math.PI * 2.0);
startAngle += Math.PI * 2.0 * (startAngle >= Math.PI ? -1 : startAngle < -Math.PI ? 1 : 0);
var endAngle = startAngle + circumference;
var start = {x: Math.cos(startAngle), y: Math.sin(startAngle)};
Function buildFragment
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
buildFragment: function( elems, context, scripts, selection ) {
var j, elem, contains,
tmp, tag, tbody, wrap,
l = elems.length,
Function update
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
update: function(changed) {
var me = this;
var opts = me._options;
// Need to regenerate the model because its faster than using extend and it is necessary due to the optimization in Chart.Element.transition