Showing 14 of 116 total issues
File template.rb
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "active_support/all"
def install_standalone
set_ruby_version
Function BatchActions
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Godmin.BatchActions = (function() {
var $container;
var $selectAll;
var $selectNone;
Method column_header
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def column_header(attribute)
if @resource_service.orderable_column?(attribute.to_s)
direction =
if params[:order].present?
if params[:order].match(/\A#{attribute.to_s}_(asc|desc)\z/)
- 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 modify_article_service
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def modify_article_service(namespace = nil)
article_service =
if namespace
"admin/app/services/admin/article_service.rb"
else
Function Datetimepickers
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Godmin.Datetimepickers = (function() {
function initialize() {
initializeEvents();
initializeState();
}
Method install_engine
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def install_engine
set_ruby_version
run_ruby_script("bin/rails plugin new admin --mountable")
Function Navigation
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Godmin.Navigation = (function() {
function initialize() {
initializeEvents();
initializeState();
}
Method filter_select
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def filter_select(name, options, html_options)
unless options[:collection].is_a? Proc
raise "A collection proc must be specified for select filters"
end
Method generate_models
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate_models
generate(:model, "author name:string")
generate(:model, "article title:string body:text author:references published:boolean published_at:datetime")
gsub_file Dir.glob("db/migrate/*_create_articles.rb").first, "t.boolean :published", "t.boolean :published, default: false"
Method navbar_item
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def navbar_item(resource, url = resource, show: nil, icon: nil, **options)
show ||= lambda do
resource.is_a?(String) ? true : policy(resource).index?
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
Method _find_all
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _find_all(name, prefix, partial, details, key, locals)
Function BatchActions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Godmin.BatchActions = (function() {
var $container;
var $selectAll;
var $selectNone;
- 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 perform_batch_action
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def perform_batch_action
return unless params[:batch_action].present?
set_resource_service
set_resource_class
- 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 column_value
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def column_value(resource, attribute)
partial_override "#{controller_path}/columns/#{attribute}", resource: resource do
column_value = resource.send(attribute)
if column_value.is_a?(Date) || column_value.is_a?(Time)
- 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"