Showing 793 of 1,813 total issues
Method discover_endpoint!
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def discover_endpoint!
return if html.nil?
@format = @options[:format]
page = Nokogiri::HTML(html)
- Read upRead up
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 call
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def call(body, actor, **options)
@account = actor
@json = original_json = Oj.load(body, mode: :strict)
@options = options
- Read upRead up
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 call
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def call(row)
@account = row.bulk_import.account
@data = row.data
@type = row.bulk_import.type.to_sym
- Read upRead up
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 render
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { intl, onPaste, autoFocus } = this.props;
const { highlighted } = this.state;
const disabled = this.props.isSubmitting;
Function render
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { attachment, displayWidth } = this.props;
const { visible, loaded } = this.state;
const width = `${Math.floor((displayWidth - 4) / 3) - 4}px`;
Class DeleteAccountService
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class DeleteAccountService < BaseService
include Payloadable
ASSOCIATIONS_ON_SUSPEND = %w(
account_notes
File feed_manager.rb
has 305 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'singleton'
class FeedManager
include Singleton
include Redisable
Method to_s
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def to_s
return html if custom_emojis.empty? || html.blank?
tree = Nokogiri::HTML.fragment(html)
tree.xpath('./text()|.//text()[not(ancestor[@class="invisible"])]').to_a.each do |node|
- Read upRead up
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 call
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def call(uri, options = {})
return if uri.blank?
process_options!(uri, options)
- Read upRead up
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 self_destruct
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def self_destruct
require 'tty-prompt'
prompt = TTY::Prompt.new
- Read upRead up
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 media_attachment.rb
has 299 lines of code (exceeds 250 allowed). Consider refactoring. Open
class MediaAttachment < ApplicationRecord
self.inheritance_column = nil
include Attachmentable
ScrollableList
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class ScrollableList extends PureComponent {
static contextTypes = {
router: PropTypes.object,
};
Class NotifyService
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class NotifyService < BaseService
include Redisable
NON_EMAIL_TYPES = %i(
admin.report
Class FeedManager
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class FeedManager
include Singleton
include Redisable
# Maximum number of items stored in a single feed
File scrollable_list.jsx
has 297 lines of code (exceeds 250 allowed). Consider refactoring. Open
import PropTypes from 'prop-types';
import { Children, cloneElement, PureComponent } from 'react';
import classNames from 'classnames';
Function render
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { selectedFilter, advancedMode, intl } = this.props;
const renderedElement = !advancedMode ? (
<div className='notification__filter-bar'>
<button
Method call
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def call(uri, id: true, prefetched_body: nil, on_behalf_of: nil, expected_actor_uri: nil, request_id: nil)
return if domain_not_allowed?(uri)
@request_id = request_id || "#{Time.now.utc.to_i}-status-#{uri}"
@json = if prefetched_body.nil?
- Read upRead up
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_note_items
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def process_note_items(items)
status_ids = items.filter_map do |item|
next unless item.is_a?(String) || item['type'] == 'Note'
uri = value_or_id(item)
- Read upRead up
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 22 (exceeds 5 allowed). Consider refactoring. Open
def import(path)
imported = 0
skipped = 0
failed = 0
category = options[:category] ? CustomEmojiCategory.find_or_create_by(name: options[:category]) : nil
- Read upRead up
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 media.rb
has 295 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative 'base'
module Mastodon::CLI
class Media < Base
include ActionView::Helpers::NumberHelper