Showing 41 of 115 total issues
Function refresh_custom_select
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
refresh_custom_select: function ($select, force_refresh) {
var self = this;
var maxWidth = 0,
$customSelect = $select.next(),
$options = $select.find('option'),
Function hide
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
hide : function (el, css) {
// is modal
if (css) {
if (/pop/i.test(this.settings.animation)) {
var end_css = {
Function events
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
events : function () {
var self = this;
$(this.scope)
.on('click.fndtn.clearing', 'ul[data-clearing] li',
Function cookie
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
var config = $.cookie = function (key, value, options) {
// Write
if (arguments.length > 1 && !$.isFunction(value)) {
Function init
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
init : function (section, method, options) {
Foundation.inherit(this, 'data_options');
var self = this;
if (typeof method === 'object') {
Function events
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
events : function () {
var self = this;
$(this.scope)
.on('click.fndtn.section', '[data-section] .title, [data-section] [data-section-title]', function (e) {
Function pos_phone
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
pos_phone : function (init) {
var tip_height = this.outerHeight(this.settings.$next_tip),
tip_offset = this.settings.$next_tip.offset(),
target_height = this.outerHeight(this.settings.$target),
$nub = $('.joyride-nub', this.settings.$next_tip),
Function cookie
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
var config = $.cookie = function (key, value, options) {
// write
if (value !== undefined) {
options = $.extend({}, config.defaults, options);
Method role_properties_for
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def role_properties_for(rolenames)
roles = rolenames.to_set
rps = Set.new unless block_given?
roles_for(rolenames).each do |host|
host.roles.intersection(roles).each do |role|
- 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 indexOf
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) {
"use strict";
if (this == null) {
throw new TypeError();
}
Function _init
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
_init: function (idx, slider) {
var self = this,
$slides_container = $(slider),
$container = $slides_container.wrap(self._container_html()).parent(),
$slides = $slides_container.children();
Function position_titles
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
position_titles : function (section, off) {
var self = this,
titles = section
.children(this.settings.region_selector)
.map(function () {
Function init
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
init : function (scope, libraries, method, options, response, /* internal */ nc) {
Method setup_filters
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def setup_filters
@filters = cmdline_filters
@filters += @custom_filters if @custom_filters
@filters << Filter.new(:role, ENV["ROLES"]) if ENV["ROLES"]
@filters << Filter.new(:host, ENV["HOSTS"]) if ENV["HOSTS"]
- 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 initialize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def initialize(type, values=nil)
raise "Invalid filter type #{type}" unless %i(host role).include? type
av = Array(values)
@strategy = if av.empty? then EmptyFilter.new
elsif av.include?(:all) || av.include?("all") then NullFilter.new
- 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 select?
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def select?(options)
options.each do |k, v|
callable = v.respond_to?(:call) ? v : ->(server) { server.fetch(v) }
result = \
case k
- 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 gets
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def gets
return unless stdin.tty?
if echo?
stdin.gets
- 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 regex_matcher
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def regex_matcher(values)
values.map! do |v|
case v
when Regexp then v
else
- 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 install
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def install(plugin, load_hooks: true, load_immediately: false)
plugin = plugin.is_a?(Class) ? plugin.new : plugin
plugin.define_tasks
plugin.register_hooks if load_hooks
- 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 print_deprecation_warnings_if_applicable
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def print_deprecation_warnings_if_applicable
if using_default_scm?
warn_add_git_to_capfile unless scm_plugin_installed?
elsif built_in_scm_name?
warn_set_scm_is_deprecated
- 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"