Showing 195 of 302 total issues
Function makeSpritedButtonRow
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function makeSpritedButtonRow() {
var buttonBar = panels.buttonBar;
var normalYShift = "0px";
Function onTouchMove
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function onTouchMove(event) {
// If slider is not touched - exit
if (!_this.isTouched || params.onlyExternal) return
Method generate
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.generate
categories = [
'Arbeidsliv',
'Arbeidsmiljø',
'Arbeidsvilkår',
Function str
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function str(key, holder) {
// Produce a string from holder[key].
var i, // The loop counter.
Method generate_agreement_stats
has 69 lines of code (exceeds 25 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
Function doList
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
commandProto.doList = function (chunk, postProcessing, isNumberedList) {
// These are identical except at the very beginning and end.
// Should probably use the regex extension function to make this clearer.
var previousItemsRegex = /(\n|^)(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*$/;
Class Proposition
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Proposition < ActiveRecord::Base
include Hdo::Search::Index
settings(SearchSettings.default) {
mappings {
Function _extendSwiperSlide
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_this._extendSwiperSlide = function (el) {
el.append = function () {
_this.wrapper.appendChild(el);
_this.reInit();
return el;
Function template
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function template(templateSpec, env) {
if (!env) {
throw new Exception("No environment passed to template");
}
Function createCart
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
createCart: function (el) {
var items, template, callbacks;
items = [];
template = this.templates['shopping-cart-template'];
Function __module3__
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var __module3__ = (function(__dependency1__) {
"use strict";
var __exports__ = {};
/*jshint -W004 */
var SafeString = __dependency1__;
Function onTouchStart
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function onTouchStart(event) {
//Exit if slider is already was touched
if (_this.isTouched || params.onlyExternal) {
return false
Function createDialog
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var createDialog = function () {
// The main dialog box.
dialog = doc.createElement("div");
dialog.className = "wmd-prompt-dialog";
Function facetSearch
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
facetSearch: function (opts) {
var baseUrl, root, template, spinner, query, cart, issueId;
baseUrl = opts.baseUrl;
root = opts.root;
Method import_vote
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
def import_vote(xvote)
log_import xvote
xvote.validate!
vote = Vote.find_by_external_id xvote.external_id
- 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 pushTag
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var pushTag = function (tag) {
if (!tag || (!tagIsValid) || tag.length <= 0) return;
if (tagManagerOptions.CapitalizeFirstLetter && tag.length > 1) {
tag = tag.charAt(0).toUpperCase() + tag.slice(1).toLowerCase();
Class VoteCounts
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class VoteCounts
attr_reader :for_count, :against_count, :absent_count
def initialize(vote)
@for_count = vote.for_count || 0
Class IssueUpdater
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class IssueUpdater
class Unauthorized < StandardError
end
Method import_vote
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def import_vote(xvote)
log_import xvote
xvote.validate!
vote = Vote.find_by_external_id xvote.external_id
Function setupCarts
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setupCarts: function () {
var toggleRow, promiseTemplate, propositionTemplate;
this.promiseCart = this.createCart($('.cart[data-type=promises]'));
this.propositionCart = this.createCart($('.cart[data-type=propositions]'));