Showing 38 of 231 total issues
Method other_promoted
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def other_promoted
@limit = @limit.to_i
response = api_execute(:get_account_history, 'null', -@limit, @limit)
history = response.result
- 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
File accounts_controller.rb
has 287 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'open-uri'
require 'json'
class AccountsController < ApplicationController
before_action :prune_account_votes_cache
Class AccountsController
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class AccountsController < ApplicationController
before_action :prune_account_votes_cache
helper_method :suggested_voters, :votes_today, :accounts
def index
Method index
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def index
@request_at = Time.now
@activity_after = Time.parse(params[:activity_after].presence || '1970-01-01T00:00:00Z')
@activity_before = Time.parse(params[:activity_before].presence || @request_at.to_s)
@op = params[:op].presence || 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"
Further reading
Method query
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def query(options = {})
data_labels = %w(
author_reputation percent_steem_dollars promoted category net_votes
total_pending_payout_value
)
- 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 query
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def query(options = {})
options[:limit] ||= 100
tag = options[:tag]
flagged_by = options.delete(:flagged_by) || []
by_trending = discussions_by_trending(options)
- 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 query
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
def query(options = {})
data_labels = %w(
author_reputation percent_steem_dollars promoted category net_votes
total_pending_payout_value
)
Method query
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def query(options = {})
options[:limit] ||= 100
tag = options[:tag]
by_cashout = discussions_by_cashout(tag, options)
- 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 query
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def query(options = {})
options[:limit] ||= 100
tag = options[:tag]
min_reputation = options[:min_reputation].presence || 25
exclude_tags = options[:exclude_tags].presence || ''
- 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 vote_ready
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def vote_ready
options = {
limit: 100
}
- 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 other_promoted
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def other_promoted
@limit = @limit.to_i
response = api_execute(:get_account_history, 'null', -@limit, @limit)
history = response.result
Method index
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def index
@request_at = Time.now
@activity_after = Time.parse(params[:activity_after].presence || '1970-01-01T00:00:00Z')
@activity_before = Time.parse(params[:activity_before].presence || @request_at.to_s)
@op = params[:op].presence || nil
Method net_transfers
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def net_transfers
@compare_to = params[:compare_to]
@account_name = params[:account_name]
@days = (params[:days] || '14.0').to_f
@symbol = params[:symbol] || default_debt_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 capture_chart
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def capture_chart(pair)
fmt = params[:format]
base_href = "https://www.worldcoinindex.com"
btc_usd = "#{base_href}/widget/renderWidget?size=large&from=BTC&to=usd&clearstyle=true&ms5=#{md5_title}"
Method index
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def index
@other_promoted = params[:other_promoted].presence || 'false'
@predicted = params[:predicted].presence || 'false'
@trending_flagged = params[:trending_flagged].presence || 'false'
@trending_by_reputation = params[:trending_by_reputation].presence || 'false'
- 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 index
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def index
@other_promoted = params[:other_promoted].presence || 'false'
@predicted = params[:predicted].presence || 'false'
@trending_flagged = params[:trending_flagged].presence || 'false'
@trending_by_reputation = params[:trending_by_reputation].presence || 'false'
Method net_transfers
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def net_transfers
@compare_to = params[:compare_to]
@account_name = params[:account_name]
@days = (params[:days] || '14.0').to_f
@symbol = params[:symbol] || default_debt_asset
Method discussions_by_cashout
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def discussions_by_cashout(tag, options = {})
by_cashout = []
if !!tag
response = api_execute(:get_discussions_by_cashout, options)
- 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 accounts_created
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def accounts_created
@days = (params[:days] || '14.0').to_f
@segments = params[:segments] || 'default'
@average = 0
@style = params[:style] || 'default'
- 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 capture_chart
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def capture_chart(pair)
fmt = params[:format]
base_href = "https://www.worldcoinindex.com"
btc_usd = "#{base_href}/widget/renderWidget?size=large&from=BTC&to=usd&clearstyle=true&ms5=#{md5_title}"
- 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"