Showing 47 of 62 total issues
Avoid too many return
statements within this method. Open
return true if settings.config['kyc'].include?(login)
Avoid too many return
statements within this method. Open
return true if settings.config['kyc'].include?(login)
Method features
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def features(*list)
return if @locals[:guser] && vip?
list.each do |f|
next unless settings.toggles.get("stop:#{f}", 'no') == 'yes'
raise WTS::UserError, "E177: This feature \"#{f}\" is temporarily disabled, sorry"
- 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 country
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def country(ip = request.ip)
settings.zache.get("ip_to_country:#{ip}") do
geo = Geoplugin.new(request.ip, ssl: true, key: settings.config['geoplugin_token'])
geo.nil? ? '??' : geo.countrycode
rescue StandardError
- 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 acquire
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def acquire(login = nil)
row = if login.nil?
@pgsql.exec(
[
'SELECT address FROM asset',
- 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 parsed_amount
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parsed_amount
raise WTS::UserError, 'E110: Parameter "amount" is not provided' if params[:amount].nil?
param = params[:amount]
amount = if /^[0-9]+z$/.match?(param)
Zold::Amount.new(zents: param.to_i)
- 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 reconcile
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def reconcile
done = 0
errors = 0
all(show_empty: true).each do |a|
after = @sibit.balance(a[:address])
- 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"