Showing 316 of 336 total issues
Method get
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get(attr_name, expand = false)
# Reading an attribute, we may get back a nil model.
attr_name = attr_name.to_sym
check_valid_field_name(attr_name)
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
def initialize(builder, app_url, app_path, component_paths)
Opal::Processor.source_map_enabled = Volt.source_maps?
Opal::Processor.const_missing_enabled = true
# Setup Opal paths
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
def initialize
# rbnacl is not supported on windows.
windows = Gem.win_platform?
if windows
- 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 duration_in_words
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def duration_in_words(places=2, min_unit=:minutes, recent_message='just now')
parts = []
secs = to_i
UNIT_MAP.each_pair do |unit, count|
val = (secs / count).floor
- 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 filtered_attributes
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def filtered_attributes
# Run the read permission check
allow_and_deny_fields(:read).then do |allow, deny|
result = 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 components
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def components
return @components if @components
@components = {}
app_folders do |app_folder|
- 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 validate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def self.validate(model, field_name, args)
if RUBY_PLATFORM != 'opal'
if args
value = model.get(field_name)
- 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 start_message_bus
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def start_message_bus
return if ENV['NO_MESSAGE_BUS']
unless RUBY_PLATFORM == 'opal'
- 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 connect!
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def connect!
# The websocket url can be overridden by config.public.websocket_url
socket_url = Volt.config.try(:public).try(:websocket_url) || begin
"#{`document.location.host`}/socket"
end
Function fix
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
fix: function( event ) {
if ( event[ jQuery.expando ] ) {
return event;
}
Function propFilter
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function propFilter( props, specialEasing ) {
var index, name, easing, value, hooks;
// camelCase, specialEasing and expand cssHook pass
for ( index in props ) {
Method rezero_bindings
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def rezero_bindings(html, bindings)
@@base_binding_id ||= 20_000
# rezero
parts = html.split(/(\<\!\-\- \$\/?[0-9]+ \-\-\>)/).reject { |v| v == '' }
Method filtered_attributes
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def filtered_attributes
# Run the read permission check
allow_and_deny_fields(:read).then do |allow, deny|
result = nil
Method initialize
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(thor, name, options)
@thor = thor
@component_name = name.chomp('/')
@name = 'volt-' + @component_name # remove trailing slash if present
@shell = Thor::Base.shell.new
Function off
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
off: function( types, selector, fn ) {
var handleObj, type;
if ( types && types.preventDefault && types.handleObj ) {
// ( event ) dispatched jQuery.Event
handleObj = types.handleObj;
Function offset
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
jQuery.fn.offset = function( options ) {
if ( arguments.length ) {
return options === undefined ?
this :
this.each(function( i ) {
Function *
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
"*": [function( prop, value ) {
var tween = this.createTween( prop, value ),
target = tween.cur(),
parts = rfxnum.exec( value ),
unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
Function clone
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
var i, l, srcElements, destElements,
clone = elem.cloneNode( true ),
inPage = jQuery.contains( elem.ownerDocument, elem );
Method start_tag
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def start_tag(tag, tag_name, rest, unary)
section_tag = tag_name[0] == ':' && tag_name[1] =~ /[A-Z]/
if section_tag
tag_name = tag_name.underscore
Method compile
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def compile
say "Starting Precompile...", :red
require 'fileutils'
ENV['SERVER'] = 'true'
ENV['MAPS'] = 'false'