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;
    }
Severity: Minor
Found in app/javascript/components/external/vcwiz/global/shared/icon_line.jsx - About 25 mins to fix

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?
Severity: Minor
Found in app/models/tracking_pixel.rb - About 25 mins to fix

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|
Severity: Minor
Found in app/controllers/external/concerns/censorable.rb - About 25 mins to fix

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|
Severity: Minor
Found in lib/competitor_lists/base/instance_results.rb - About 25 mins to fix

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
Severity: Minor
Found in lib/competitor_lists/base/class_sql.rb - About 25 mins to fix

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]
Severity: Minor
Found in lib/competitor_lists/most_recent_in.rb - About 25 mins to fix

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'
Severity: Minor
Found in lib/competitor_lists/base/class_sortable.rb - About 25 mins to fix

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?
Severity: Minor
Found in lib/importers/external/ffc.rb - About 25 mins to fix

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
Severity: Minor
Found in app/controllers/external/auth_controller.rb - About 25 mins to fix

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
Severity: Minor
Found in lib/competitor_lists/filtered.rb - About 25 mins to fix

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'])
        (
Severity: Minor
Found in lib/http/angel_list/base.rb - About 25 mins to fix

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

Severity
Category
Status
Source
Language