Showing 29 of 60 total issues
Method confirm_button_with_class
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def confirm_button_with_class(name, path, confirm_text, classes, disabled=false, method=:get)
Avoid deeply nested control flow statements. Open
if (h == 0) tmph = 12 +'a';
else if (h < 12) tmph += 'a';
else tmph += 'p';
Avoid deeply nested control flow statements. Open
if(this.millisec > this._defaults.millisecMax) this.millisec = this._defaults.millisecMax;
Avoid deeply nested control flow statements. Open
if (aph == 12) h = 0;
else h = aph;
Avoid deeply nested control flow statements. Open
} else if (aph == 12) h = 12;
else h = aph + 12;
Avoid deeply nested control flow statements. Open
if(this.millisec < this._defaults.millisecMin)
this.millisec = this._defaults.millisecMin;
Method location
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def location(location=[])
unless location.blank?
loc = location.is_a?(Array) ? location[0] : location
geo = Geocoder.search(loc.gsub("-", " "))[0]
if geo
- 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 all
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def all
auth = request.env['omniauth.auth']
# Find an identity here
@identity = Identity.find_with_omniauth(auth)
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
def update
@user = current_user
email_changed = @user.email != params[:user][:email]
password_changed = false
if params[:user][:password]
- 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"