Showing 211 of 594 total issues
Function render
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { icon, line, link, text, className } = this.props;
if (!line && (!text || !link)) {
return null;
}
- Read upRead up
- Create a ticketCreate a ticket
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 user_agent=
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def user_agent=(user_agent)
browser = Browser.new(user_agent, accept_language: 'en-us')
self.open_device_type = if browser.device.mobile?
:mobile
elsif browser.device.tablet?
- Read upRead up
- Create a ticketCreate a ticket
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 filter_unless_portfolio
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def filter_unless_portfolio(paths, object)
base = JSON.parse object.to_json
return base if current_external_founder&.drf?
paths.each do |path|
- Read upRead up
- Create a ticketCreate a ticket
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 fetch_cached_results
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def fetch_cached_results
results = Rails.application.redis_cache.fetch(cache_key('results'))
return results unless results.present?
targets = targets_for_investors(results)
results.each do |competitor|
- Read upRead up
- Create a ticketCreate a ticket
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 _base_sql
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _base_sql(founder, sql, meta_sql, order, limit, offset, include_targets: false)
fetch_targets = cache_key_attrs.blank? && founder.present? && include_targets
distinct_sql = <<-SQL
SELECT DISTINCT ON (fullquery.id) fullquery.*
FROM (#{sql}) AS fullquery
- Read upRead up
- Create a ticketCreate a ticket
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 cache_key_attrs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.cache_key_attrs
{
industry: lambda do |founder|
return nil unless (company = founder.primary_company).present?
company.industry && company.industry[arg_count]
- Read upRead up
- Create a ticketCreate a ticket
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 order_sql_from_sort
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def order_sql_from_sort(sort)
sort
.select { |s, d| d != 0 }
.map do |s, d|
direction = d == 1 ? 'ASC' : 'DESC'
- Read upRead up
- Create a ticketCreate a ticket
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 process!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.process!(row)
row[:tags] = row[:tags].split(',')
first_name, last_name = Util.split_name(row[:full_name])
if row[:firm].present?
- Read upRead up
- Create a ticketCreate a ticket
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 failure
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def failure
if params[:message] == 'access_denied' && params[:strategy] == 'gmail' && !external_founder_signed_in?
redirect_to omniauth_path('google_external', hd: cookies[:login_domain])
else
redirect_to external_founder_signed_in? ? after_sign_in_path_for(current_external_founder) : external_vcwiz_root_path
- Read upRead up
- Create a ticketCreate a ticket
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 match_sql
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def match_sql
cols = [
params[:search].present? ? 'searched.match_id' : nil,
params[:filters][:entities].present? ? 'entities_searched.match_id' : nil,
].compact
- Read upRead up
- Create a ticketCreate a ticket
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 find_id
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.find_id(query, org: nil, cb_id: nil)
results = api_get('/search', query: query, type: resource.titleize)
filtered = results.select do |r|
result = new(r['id'])
(
- Read upRead up
- Create a ticketCreate a ticket
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"