Showing 42 of 95 total issues
Function RemoteValidator
has 259 lines of code (exceeds 25 allowed). Consider refactoring. Open
var RemoteValidator = function( form )
{
// self
var v = this;
var body = jQuery('body');
Function UrlBuilder
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
function UrlBuilder( params )
{
if( params === undefined )
{
params = {};
- 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 add
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
UrlBuilder.prototype.add = function( params, value )
{
if( params instanceof Array )
{
for( var i = 0; i < params.length; i++ )
- 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
Class TableBuilder
has 37 methods (exceeds 20 allowed). Consider refactoring. Open
class Releaf::Builders::TableBuilder
include Releaf::Builders::Base
include Releaf::Builders::Toolbox
attr_accessor :collection, :options, :template, :resource_class
Class LayoutBuilder
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
class LayoutBuilder
include Releaf::Builders::Base
include Releaf::Builders::Template
def output(&block)
File remote_validator.js
has 316 lines of code (exceeds 250 allowed). Consider refactoring. Open
var RemoteValidator = function( form )
{
// self
var v = this;
var body = jQuery('body');
Class Settings
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class Releaf::Settings < ActiveRecord::Base
self.table_name = table_name_prefix + "settings"
class SettingNotFound < RuntimeError; end
Class ActionController
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class Releaf::ActionController < ActionController::Base
# must be first other in stange way non-text env will
# have CSRF on richtext attachment upload
protect_from_forgery
Function UrlBuilder
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
function UrlBuilder( params )
{
if( params === undefined )
{
params = {};
Class TranslationsStore
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Releaf::I18nDatabase::TranslationsStore
include Releaf::InstanceCache
attr_accessor :updated_at, :missing_keys
def initialize
Class IndexBuilder
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Releaf::Builders::IndexBuilder
include Releaf::Builders::View
include Releaf::Builders::Collection
def header_extras
Function add
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
UrlBuilder.prototype.add = function( params, value )
{
if( params instanceof Array )
{
for( var i = 0; i < params.length; i++ )
Method has_error?
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def has_error?(error_message, options = {})
error_found = false
if options[:field]
first('.field.has-error', minimum: 1) # wait for any errors to come from validation
all(".field.has-error", wait: false).each do |field_container|
- 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 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function( editor )
{
var me = this;
CKEDITOR.dialog.add( 'MediaEmbedDialog', function (instance)
{
Method store_settings
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def store_settings
settings = params.permit(settings: [:key, :value]).to_h.fetch(:settings, nil)
if settings
settings.each do|item|
next if item[:key].nil? || item[:value].nil?
- 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 join_reflection_without_through
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def join_reflection_without_through(reflection, table)
klass = reflection.active_record
other_class = reflection.klass
table1 = table || klass.arel_table
Method verify_resources_config
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def verify_resources_config(resource_config)
# perform some basic config structure validation
unless resource_config.is_a? Hash
raise Releaf::Error, "Releaf.application.config.content.resources must be a Hash"
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 getUrl
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
UrlBuilder.prototype.getUrl = function()
{
var query = '';
var isFirst = true;
for( var i in this.query )
- 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 releaf_resources
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def releaf_resources(*args)
resources(*args) do
yield if block_given?
member do
get :confirm_destroy if route_enabled?(:destroy, args.last)
- 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 mount_releaf_at
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def mount_releaf_at(mount_location)
mount_location_namespace = mount_location.delete("/").to_sym
Releaf.application.config.mount_location = mount_location_namespace.to_s
scope mount_location do
initialize_releaf_components
- 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"