Showing 211 of 594 total issues

Header has 26 functions (exceeds 20 allowed). Consider refactoring.
Open

export default class Header extends React.Component {
  static defaultProps = {
    showLogin: true,
    openLoginOnLoad: false,
    logoLinkPath: DiscoverPath,
Severity: Minor
Found in app/javascript/components/external/vcwiz/global/shared/header.jsx - About 3 hrs to fix

Method augment_with_clearbit has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

  def augment_with_clearbit(founder)
    response = Http::Clearbit.new(founder, founder.primary_company).enhance
    return unless response&.person.present?

    founder.city = response.person.geo.city if founder.city.blank?
Severity: Minor
Found in app/jobs/founder_enhance_job.rb - About 2 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

Function componentDidMount has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

  componentDidMount() {
    if (this.props.item.id) {
      if (this.history) {
        let tab = document.location.hash && parseInt(document.location.hash.substr(1), 10);
        if (!this.props.item.partners || tab >= this.props.item.partners.length) {

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 founder.rb has 286 lines of code (exceeds 250 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 2 hrs to fix

Class Pitch has 25 methods (exceeds 20 allowed). Consider refactoring.
Open

class Pitch < ApplicationRecord
  include Concerns::Cacheable

  SNAPSHOT_DEADLINE = 2.days

Severity: Minor
Found in app/models/pitch.rb - About 2 hrs to fix

Class VCWizController has 24 methods (exceeds 20 allowed). Consider refactoring.
Open

class External::VCWiz::VCWizController < External::FrontendController
  include External::Concerns::Filterable
  include External::Concerns::Sortable
  include External::Concerns::Censorable

Severity: Minor
Found in app/controllers/external/vcwiz/vcwiz_controller.rb - About 2 hrs to fix

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

  def crawl_posts!
    new_posts = fetch_posts!
    existing = Set.new Post.where(url: new_posts.map { |p| p[:url] }).pluck(:url)

    new_posts.reject { |p| existing.include? p[:url] }.each do |meta|
Severity: Minor
Found in app/models/investor.rb - About 2 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 populate_from_cb! has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

  def populate_from_cb!
    person = crunchbase_person
    return unless person.present? && person.found?

    self.photo = person.image
Severity: Minor
Found in app/models/investor.rb - About 2 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 perform has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

  def perform
    Team.for_each do |team|
      pending = team.companies.undecided.where('pitches.when <= ?', Date.today.in_time_zone(team.time_zone)).distinct
      pending.each do |company|
        next unless company.pitch.votes.present?
Severity: Minor
Found in app/jobs/vote_monitor_job.rb - About 2 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 company.rb has 273 lines of code (exceeds 250 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 2 hrs to fix

ImportInvestorsModal has 23 functions (exceeds 20 allowed). Consider refactoring.
Open

@hasModalErrorBoundary
export default class ImportInvestorsModal extends React.Component {
  state = {
    stage: Stage.START,
    id: null,

Class Message has 23 methods (exceeds 20 allowed). Consider refactoring.
Open

class Message
  INTERESTED_PRHASES = [
    'love the opportunity',
    'move forward',
    'allocation',
Severity: Minor
Found in lib/message.rb - About 2 hrs to fix

Class InvestorsController has 23 methods (exceeds 20 allowed). Consider refactoring.
Open

class External::Api::V1::InvestorsController < External::Api::V1::ApiV1Controller
  include External::Concerns::Censorable
  include External::ApplicationHelper

  LIMIT = 10
Severity: Minor
Found in app/controllers/external/api/v1/investors_controller.rb - About 2 hrs to fix

File header.jsx has 270 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import {
  Badge,
  Button,
  Colors,
Severity: Minor
Found in app/javascript/components/external/vcwiz/global/shared/header.jsx - About 2 hrs to fix

Method _filtered has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

  def _filtered
    competitors = if params[:search].present?
      Competitor.joins("INNER JOIN (#{_filtered_by_search_subquery(params[:search])}) AS searched ON competitors.id = searched.id")
    else
      Competitor.all
Severity: Minor
Found in lib/competitor_lists/filtered.rb - About 2 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

PartnerTab has 22 functions (exceeds 20 allowed). Consider refactoring.
Open

export default class PartnerTab extends React.Component {
  static defaultProps = {
    fetch: true,
    initiallyExpanded: false,
  };

Class Team has 22 methods (exceeds 20 allowed). Consider refactoring.
Open

class Team < ApplicationRecord
  include Concerns::Slackable
  include Concerns::Cacheable
  include ActionView::Helpers::NumberHelper

Severity: Minor
Found in app/models/team.rb - About 2 hrs to fix

FixedTable has 22 functions (exceeds 20 allowed). Consider refactoring.
Open

export default class FixedTable extends React.Component {
  static defaultProps = {
    rowHeight: 80,
    headerHeight: 50,
  };

Class Base has 22 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Base
    extend Concerns::Cacheable

    include HTTParty
    base_uri 'https://api.crunchbase.com/v3.1/'
Severity: Minor
Found in lib/http/crunchbase/base.rb - About 2 hrs to fix

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

  def process_outgoing!(founder, skip_graph)
    recipients.each do |addr|
      founder.connect_to_addr!(addr, :email) if valid_connection?(addr) && !skip_graph
      target = TargetInvestor.from_addr(founder, addr, create: true)
      next unless target.present?
Severity: Minor
Found in lib/message.rb - About 2 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

Severity
Category
Status
Source
Language