Showing 261 of 342 total issues
Method include_page?
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def include_page?(page)
return true unless page.page?
unless @exclude_pages.nil?
rejected = @exclude_pages.any? { |selector| match_page(selector, page) }
return false if rejected
- 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 fields
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def fields
field_lists = Hash.new { |h, k| h[k] = [] }
# collect all the definitions for a particular field or group
all_types.select { |t| include_type?(t) }.each do |type|
type.field_prototypes.each do |prototype|
- 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 smush!
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def smush!
p src_file
return if ::Spontaneous.development?
ext = @format.nil? ? File.extname(src_file) : ".#{@format}"
id = [Time.now.to_i, Time.now.usec].join('-')
- 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 init
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def init(options={})
@@semaphore.synchronize do
self.environment = (options.delete(:environment) || ENV["SPOT_ENV"] || :development)
self.mode = options.delete(:mode) || ENV["SPOT_MODE"] || :back
root = options.delete(:root) || ENV["SPOT_ROOT"] || Dir.pwd
- 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 append_features
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def append_features(base)
if base.instance_variable_defined?("@_dependencies")
base.instance_variable_get("@_dependencies") << self
return false
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
Function Boolean
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spontaneous.Field.Boolean = (function($, S) {
var dom = S.Dom
, _unprocessed_value_ = 'unprocessed_value';
var BooleanField = new JS.Class(Spontaneous.Field.String, {
Method application
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.application(site = ::Spontaneous.instance)
::Rack::Builder.new do
site.back_controllers.each do |namespace, controller|
map(namespace) do
use Scope::Edit, site
Function on_select
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
on_select: function(event) {
var input = this.input(), toolbar = this.popupToolbar(), state = TextCommand.get_state(input);
$.each(this.commands, function() {
this.respond_to_selection(state);
});
Function insert_entry
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
insert_entry: function(entry, position) {
this.trigger('entry_added', entry, position);
var entries = this.entries()
, w = this.entry_wrappers()
, e = this.view_for_entry(entry)
Function getSelectionPosition
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
getSelectionPosition: function() {
var cal = calculator, self = this, element = self[0], elementOffset = self.offset();
cal.simulator.empty();
// clone primary styles to imitate textarea
Method application
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.application(site = ::Spontaneous.instance)
::Rack::Builder.new do
use Scope::Front, site
use Spontaneous::Rack::Static, root: Spontaneous.revision_dir / 'public', urls: %w[/], try: ['.html', 'index.html', '/index.html']
Function parse_selector
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
parse_selector: function(selector) {
var p, id = '', classes = [], result = {};
selector = selector || '';
if (typeof selector === 'string') {
p = selector.split('.');
Function drop
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
var drop = function(event) {
event.stopPropagation();
event.preventDefault();
dropper.removeClass('drop-active').addClass('uploading');
var files = event.dataTransfer.files;
Method parse_response
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_response(response)
case
when response.is_a?(site.model)
@page = response
when response.respond_to?(:to_str)
Method load_classes_with_requirements
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def load_classes_with_requirements(klasses)
klasses.uniq!
while klasses.size > 0
# Note size to make sure things are loading
Method validate!
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def validate!
begin
validate_schema
rescue Spontaneous::SchemaModificationError => e
changes = e.modification
Function Editing
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Spontaneous.Editing = (function($, S) {
var dom = S.Dom, Page = S.Page;
var Editing = new JS.Singleton({
include: Spontaneous.Properties,
- 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 render_path
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def render_path(path)
@template_params = {}
find_page!(path)
response = catch(:halt) 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 render!
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def render!(output, params, parent_context)
# See `spontaneous/output/store/transaction.rb` for the `store_output`
# clauses that explain this reasoning...
if output.protected?
# We can be sure that if the output says it's protected then it'll be
- 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 find_target
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def find_target
case @category
when :type
begin
@name.constantize
- 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"