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
- 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
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
- Create a ticketCreate a ticket
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
- Create a ticketCreate a ticket
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
- Create a ticketCreate a ticket
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
- 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
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
- Create a ticketCreate a ticket
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
- Create a ticketCreate a ticket
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
- Create a ticketCreate a ticket
File competitor.rb
has 341 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Competitor < ApplicationRecord
include Concerns::AttributeArrayable
include Concerns::Domainable
COMPETITORS = {
- Create a ticketCreate a ticket
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?
- Create a ticketCreate a ticket
Class Competitor
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
class Competitor < ApplicationRecord
include Concerns::AttributeArrayable
include Concerns::Domainable
COMPETITORS = {
- Create a ticketCreate a ticket
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
- 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 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?
- 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
LoginModal
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
export default class LoginModal extends React.Component {
constructor(props) {
super(props);
this.state = {
- Create a ticketCreate a ticket
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 {
- Create a ticketCreate a ticket
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
- 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
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';
- Create a ticketCreate a ticket
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
- 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 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
- 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
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,
- Create a ticketCreate a ticket