Showing 195 of 302 total issues
Function PreviewManager
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function PreviewManager(converter, panels, previewRefreshCallback) {
var managerObj = this;
var timeout;
var elapsedTime;
File cull.js
has 396 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var cull = (function (global) {
"use strict";
var _ = global._ || require("underscore");
var slice = Array.prototype.slice;
File bootstrap-tagsmanager.js
has 389 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* ===================================================
* bootstrap-tagmanager.js v2.2
* http://welldonethings.com/tags/manager
* ===================================================
* Copyright 2012 Max Favilli
File issueEditor.js
has 354 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*global jQuery, HDO, Handlebars */
(function ($, HDO, Handlebars) {
HDO.issueEditor = {
create: function (opts) {
Function __module6__
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var __module6__ = (function(__dependency1__, __dependency2__, __dependency3__) {
"use strict";
var __exports__ = {};
var Utils = __dependency1__;
var Exception = __dependency2__;
Method generate_agreement_stats
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
Open
def generate_agreement_stats
all_categories = !!ENV['ALL_CATEGORIES']
exclude_budget = !!ENV['EXCLUDE_BUDGET']
sessions = ParliamentSession.where('start_date > ?', Time.parse('2009-08-31')).order(:start_date).to_a
- 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 prompt
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ui.prompt = function (text, defaultInputText, callback) {
// These variables need to be declared at this level since they are used
// in multiple functions.
var dialog; // The dialog box.
Function parse
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
parse: function parse(input) {
var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
this.lexer.setInput(input);
this.lexer.yy = this.yy;
this.yy.lexer = this.lexer;
File persister.rb
has 330 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module Hdo
module Import
class Persister
attr_writer :log
Function TextareaState
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function TextareaState(panels, isInitialState) {
// Aliases
var stateObj = this;
var inputArea = panels.input;
File facet_search.rb
has 325 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module Hdo
module Search
module FacetSearch
extend ActiveSupport::Concern
Function doBlockquote
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
commandProto.doBlockquote = function (chunk, postProcessing) {
chunk.selection = chunk.selection.replace(/^(\n*)([^\r]+?)(\n*)$/,
function (totalMatch, newlinesBefore, text, newlinesAfter) {
chunk.before += newlinesBefore;
Class Representative
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Representative < ActiveRecord::Base
devise :database_authenticatable,
:recoverable, :rememberable, :trackable, :validatable,
:confirmable
Function anonymous
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
var $0 = $$.length - 1;
switch (yystate) {
case 1: return new yy.ProgramNode($$[$0-1], this._$);
Class Persister
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Persister
attr_writer :log
def initialize
@log = Logger.new(STDOUT)
Class CLI
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class CLI
AGREEMENT_CONFIG = {
unit: :propositions,
ignore_unanimous: true
}
Function onTouchEnd
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function onTouchEnd(event) {
// If slider is not touched exit
if ( params.onlyExternal || !_this.isTouched ) return
_this.isTouched = false
Function init
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_this.init = function(reInit) {
var _width = window.getComputedStyle(_this.container, null).getPropertyValue('width')
var _height = window.getComputedStyle(_this.container, null).getPropertyValue('height')
var newWidth = parseInt(_width,10);
var newHeight = parseInt(_height,10);
Function anonymous
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
function strip(start, end) {
return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng-end);
Function registerDefaultHelpers
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function registerDefaultHelpers(instance) {
instance.registerHelper('helperMissing', function(arg) {
if(arguments.length === 2) {
return undefined;
} else {