Showing 211 of 594 total issues

Method perform has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring.
Open

  def perform(competitor_id)
    competitor = Competitor.find(competitor_id)

    competitor.crunchbase_id ||= Http::Crunchbase::Organization.find_investor_id(competitor.name)
    begin
Severity: Minor
Found in app/jobs/competitor_crunchbase_job.rb - About 1 day 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

Class Investor has 53 methods (exceeds 20 allowed). Consider refactoring.
Open

class Investor < ApplicationRecord
  extend Concerns::Ignorable
  include Concerns::AttributeArrayable
  include Concerns::Cacheable
  include Concerns::Ignorable
Severity: Major
Found in app/models/investor.rb - About 7 hrs to fix

File investor.rb has 478 lines of code (exceeds 250 allowed). Consider refactoring.
Open

class Investor < ApplicationRecord
  extend Concerns::Ignorable
  include Concerns::AttributeArrayable
  include Concerns::Cacheable
  include Concerns::Ignorable
Severity: Minor
Found in app/models/investor.rb - About 7 hrs to fix

Class Company has 46 methods (exceeds 20 allowed). Consider refactoring.
Open

class Company < ActiveRecord::Base
  include Concerns::Cacheable
  include ActionView::Helpers::NumberHelper
  include Concerns::AttributeArrayable
  include Concerns::Domainable
Severity: Minor
Found in app/models/company.rb - About 6 hrs to fix

Method add_cb_investors has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

  def add_cb_investors
    @cb_org.investors.each do |competitor|
      next if competitor.type == 'Person'
      ignore_invalid do
        competitor = Competitor.from_crunchbase! competitor.permalink, competitor.name
Severity: Minor
Found in app/jobs/company_relationships_job.rb - About 5 hrs 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

Class User has 34 methods (exceeds 20 allowed). Consider refactoring.
Open

class User < ActiveRecord::Base
  include Concerns::Slackable
  include Concerns::Cacheable

  QUORUM_PERCENTAGE = 0.6
Severity: Minor
Found in app/models/user.rb - About 4 hrs to fix

Class Founder has 34 methods (exceeds 20 allowed). Consider refactoring.
Open

class Founder < ApplicationRecord
  include Concerns::Cacheable
  include Concerns::TimeZonable
  include Concerns::Eventable
  include Concerns::Locationable
Severity: Minor
Found in app/models/founder.rb - About 4 hrs to fix

Method perform has 108 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def perform(competitor_id)
    competitor = Competitor.find(competitor_id)

    competitor.crunchbase_id ||= Http::Crunchbase::Organization.find_investor_id(competitor.name)
    begin
Severity: Major
Found in app/jobs/competitor_crunchbase_job.rb - About 4 hrs to fix

File competitor.rb has 341 lines of code (exceeds 250 allowed). Consider refactoring.
Open

class Competitor < ApplicationRecord
  include Concerns::AttributeArrayable
  include Concerns::Domainable

  COMPETITORS = {
Severity: Minor
Found in app/models/competitor.rb - About 4 hrs to fix

Class MessagesController has 32 methods (exceeds 20 allowed). Consider refactoring.
Open

class External::Api::V1::MessagesController < External::Api::V1::ApiV1Controller
  YES_PHRASES = %w(yes y yea yeah yup)
  NO_PHRASES = %w(no n nope)

  before_action :check_signature if Rails.env.production?
Severity: Minor
Found in app/controllers/external/api/v1/messages_controller.rb - About 4 hrs to fix

Class Competitor has 31 methods (exceeds 20 allowed). Consider refactoring.
Open

class Competitor < ApplicationRecord
  include Concerns::AttributeArrayable
  include Concerns::Domainable

  COMPETITORS = {
Severity: Minor
Found in app/models/competitor.rb - About 3 hrs to fix

Method set_metrics! has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

  def set_metrics!
    return unless crunchbase_person.present?

    self.affiliated_exits = 0
    companies = Set.new
Severity: Minor
Found in app/models/founder.rb - About 3 hrs 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 import! has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    def import!(parsed)
      return unless parsed[:date].present? && parsed[:email].present? && parsed[:company].present?

      date = parsed[:date].is_a?(String) ? Chronic.parse(parsed[:date]) : parsed[:date]
      return unless date.present?
Severity: Minor
Found in lib/importers/internal/voting_base.rb - About 3 hrs 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

LoginModal has 28 functions (exceeds 20 allowed). Consider refactoring.
Open

export default class LoginModal extends React.Component {
  constructor(props) {
    super(props);

    this.state = {
Severity: Minor
Found in app/javascript/components/external/vcwiz/global/login/login_modal.jsx - About 3 hrs to fix

File login_modal.jsx has 304 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import OverlayModal from '../shared/overlay_modal';
import Input from '../fields/input';
import Filters from '../../discover/filters';
import {
Severity: Minor
Found in app/javascript/components/external/vcwiz/global/login/login_modal.jsx - About 3 hrs to fix

Method preview! has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

  def preview!
    csv = CSV.foreach(filename, headers: false, liberal_parsing: true).lazy
    begin
      headers = csv.first
    rescue ArgumentError
Severity: Minor
Found in app/models/import_task.rb - About 3 hrs 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

File import_investors_modal.jsx has 298 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import OverlayModal from '../global/shared/overlay_modal';
import { TargetInvestorsBulkImportPath, TargetInvestorsBulkPollPath, ImportHeadersOptions } from '../global/constants.js.erb';
import FileInput from '../global/fields/file_input';
import {ffetch, humanizeList} from '../global/utils';

Method perform has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

  def perform(team, card_data, deep: false, quiet: true)
    card_data = card_data.with_indifferent_access

    list = List.where(trello_id: card_data.delete(:trello_list_id)).first!
    card = Card.where(trello_id: card_data[:trello_id]).first_or_initialize
Severity: Minor
Found in app/jobs/card_sync_job.rb - About 3 hrs 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 propagate_fields! has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

  def propagate_fields!
    scope = ALL_PROP_FIELDS.inject(Investor.none) { |scope, f| scope.or(Investor.where(f => nil)) }
    scope = Investor.where(verified: false).where('target_investors_count >= ?', MIN_TARGET_COUNT).merge(scope)
    scope.includes(:target_investors).find_each do |investor|
      fields = ALL_PROP_FIELDS.map { |f| [f, Hash.new(0)] }.to_h
Severity: Minor
Found in app/jobs/find_investors_job.rb - About 3 hrs 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

File partner_tab.jsx has 292 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import {CompetitorIndustries, InvestorsPath, IntroPathTypes} from '../constants.js.erb';
import Store from '../store';
import {
  ffetchCached, getDomain, humanizeList,
Severity
Category
Status
Source
Language