Showing 7 of 11 total issues
Method formnestic_table_semantic_fields_for
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def formnestic_table_semantic_fields_for(
record_or_name_or_array, *args, &block
)
options = args.dup.extract_options!
formnestic_add_table_headers_form_attributes
Method formnestic_list_semantic_fields_for
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def formnestic_list_semantic_fields_for(
record_or_name_or_array,
*args,
&block
)
Method formnestic_list_row_inputs
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def formnestic_list_row_inputs(*args, &block)
html_options =
formnestic_prepare_html_options_for_wrapper(:list, *args)
rows_counter =
template.content_tag(
Method extend_form_builder
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def extend_form_builder
Formtastic::FormBuilder.send(
:alias_method,
:formtastic_semantic_fields_for,
:semantic_fields_for
Method formnestic_table_row_inputs
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def formnestic_table_row_inputs(*args, &block)
html_options =
formnestic_prepare_html_options_for_wrapper(:table, *args)
template.content_tag(
:tr, [
Method formnestic_link_to_add_fields_with_content
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def formnestic_link_to_add_fields_with_content(
record_or_name_or_array, *args, &block
)
relationship = object.class.reflections[record_or_name_or_array.to_s]
if relationship.nil?
Method formnestic_link_to_add_fields_with_content
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def formnestic_link_to_add_fields_with_content(
record_or_name_or_array, *args, &block
)
relationship = object.class.reflections[record_or_name_or_array.to_s]
if relationship.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"