Method update_all
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def update_all
respond_to do |format|
begin
@current_basket.checked_manifestations.map(&:manifestation).each do |m|
if m.series_statement
- 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 update_all
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_all
respond_to do |format|
begin
@current_basket.checked_manifestations.map(&:manifestation).each do |m|
if m.series_statement
Method create
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create
respond_to do |format|
if @series_has_manifestation.save
if params[:mode] == 'edit_manifestation'
format.html { redirect_to edit_manifestation_path(@series_has_manifestation.manifestation) }
- 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 update
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def update
respond_to do |format|
old_series_statement = @series_has_manifestation.series_statement
if @series_has_manifestation.update_attributes(params[:series_has_manifestation])
old_series_statement.index
- 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"