Showing 146 of 242 total issues
Method table_cell
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def table_cell column, resource, alternative_value = nil
value = '-'
if column == 'name'
value = resource.send(column)
- 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 nextMatch
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
CompetitiveList.prototype.nextMatch = function(from_start) {
var autoWinnerMatchesHtml, competitorStrings, html, i, modalBodyHtml, modalFooterHtml, modalTitle, radioButtons, rows;
autoWinnerMatchesHtml = '';
if (this.currentAutoWinnerMatches.length > 0) {
this.currentMatch = this.matches[this.currentMatchIndex];
Function setupInputListenersInput
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setupInputListenersInput(inputBinding, gmapContext) {
if (inputBinding) {
if (inputBinding.radiusInput){
inputBinding.radiusInput.on("change", function(e) {
if (!e.originalEvent) { return }
Function updateDate
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateDate(d, params, reset, advance, prefer, weekdayForward) {
var specificityIndex;
function getParam(key) {
return isDefined(params[key]) ? params[key] : params[key + 's'];
Method included
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.included(base)
base.extend ClassMethods
base.class_eval do
include Model::MongoDb::StateVersionAttributes
Function moveCompetitorToPosition
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
CompetitiveList.prototype.moveCompetitorToPosition = function(competitorId, position, after_update_request_proc) {
var defeatedCompetitor, outmatchedCompetitor, positionOfdefeatedCompetitor, positions;
if (after_update_request_proc == null) {
after_update_request_proc = null;
}
Method included
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.included(base)
base.class_eval do
has_ancestry :cache_depth => true, :orphan_strategy => :rootify
acts_as_list
File navigation.rb
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Voluntary
module Navigation
class Base
@@products = {}
@@core_menus = [:areas, :products, :organizations, :projects, :users, :workflow, :authentication]
Function runTagReplacements
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
function runTagReplacements(str, reg, strip, replacementFn, fullString) {
var match;
var result = '';
var currentIndex = 0;
Function api
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function api (key, value, attributes) {
var result;
// Write
Method included
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.included(base)
base.extend ClassMethods
base.class_eval do
include Model::MongoDb::StateVersionAttributes
Method included
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def self.included(base)
base.class_eval do
cattr_reader :per_page
@@per_page = 20
- 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 addFormat
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
addFormat: function(src, allowsTime, match, variant, iso) {
var to = match || [], loc = this, time, timeMarkers, lastIsNumeral;
src = src.replace(/\s+/g, '[,. ]*');
src = src.replace(/\{([^,]+?)\}/g, function(all, k) {
Function every
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
'every': function(amount, fn) {
var increment,
precision,
dio,
unit,
Function mouseDown
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function mouseDown(e) {
var item = $(this),
parent = item.parent(),
myIndex = item.index();
Method gem_dependencies
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def gem_dependencies
create_file 'Gemfile', ''
append_file 'Gemfile', :verbose => true do
<<-EOH
Function buildStartEndsWith
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildStartEndsWith() {
var override = true;
try {
// If String#startsWith does not exist or alternately if it exists but
// correctly throws an error here, then there is no need to flag the
Method create
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def create
build_resource(params[:user])
captcha_verified = if Rails.env == 'production'
verify_recaptcha(model: resource, message: I18n.t('general.exceptions.wrong_recaptcha'))
- 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 transition_actions
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def transition_actions(*actions)
actions = actions.first.is_a?(Symbol) ? actions : actions.first
actions.each do |action|
define_method action do
- 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 path_to
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def path_to(page_name)
case page_name
when /^the home\s?page$/
'/'