Showing 720 of 1,785 total issues
Function render
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { account, intl } = this.props;
let actionBtn;
File feed_manager.rb
has 289 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'singleton'
class FeedManager
include Singleton
include Redisable
Function userLists
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function userLists(state = initialState, action) {
switch(action.type) {
case FOLLOWERS_FETCH_SUCCESS:
return normalizeList(state, ['followers', action.id], action.accounts, action.next);
case FOLLOWERS_EXPAND_SUCCESS:
Method cull
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def cull(*domains)
skip_threshold = 7.days.ago
dry_run = options[:dry_run] ? ' (DRY RUN)' : ''
skip_domains = Concurrent::Set.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
Method cleanup_concurrent_column_type_change
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
def cleanup_concurrent_column_type_change(table, column)
temp_column = rename_column_name(column)
# Wait for the indices to be built
indexes_for(table, column).each do |index|
File card.js
has 286 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import PropTypes from 'prop-types';
import Immutable from 'immutable';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
File statuses.js
has 285 lines of code (exceeds 250 allowed). Consider refactoring. Open
import api from '../api';
import { deleteFromTimelines } from './timelines';
import { importFetchedStatus, importFetchedStatuses, importFetchedAccount } from './importer';
import { ensureComposeIsVisible, setComposeToStatus } from './compose';
File media_attachment.rb
has 285 lines of code (exceeds 250 allowed). Consider refactoring. Open
class MediaAttachment < ApplicationRecord
self.inheritance_column = nil
include Attachmentable
StatusActionBar
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
export default @connect(mapStateToProps)
@injectIntl
class StatusActionBar extends ImmutablePureComponent {
static contextTypes = {
Function render
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const style = {
fontSize: `${this.props.size}px`,
width: `${this.props.size * 1.28571429}px`,
height: `${this.props.size * 1.28571429}px`,
Function render
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { intl, myAccount, columns, multiColumn, unreadFollowRequests } = this.props;
const navItems = [];
let height = (multiColumn) ? 0 : 60;
Function normalizeWheel
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
const normalizeWheel = event => {
// Reasonable defaults
const PIXEL_STEP = 10;
const LINE_HEIGHT = 40;
const PAGE_HEIGHT = 800;
- 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 20 (exceeds 5 allowed). Consider refactoring. Open
def call(uri, id: true, prefetched_body: nil, break_on_redirect: false, only_key: false)
return if domain_not_allowed?(uri)
return ActivityPub::TagManager.instance.uri_to_resource(uri, Account) if ActivityPub::TagManager.instance.local_uri?(uri)
@json = begin
- 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 20 (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 call
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def call(uri, id: true, prefetched_body: nil)
return if uri.blank?
if prefetched_body.nil?
if id
- 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 upgrade_storage_filesystem
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def upgrade_storage_filesystem(progress, attachment, style)
previous_storage_schema_version = attachment.storage_schema_version
previous_path = attachment.path(style)
success = true
- 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 initialize
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def initialize(path, max_frames = 2)
@path = path
@nb_frames = 0
File.open(path, 'rb') do |s|
- 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 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { accounts, lastStatus, unread, scrollKey, intl } = this.props;
if (lastStatus === null) {
return null;
Method update_column_in_batches
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_column_in_batches(table_name, column, value)
if transaction_open?
raise 'update_column_in_batches can not be run inside a transaction, ' \
'you can disable transactions by calling disable_ddl_transaction! ' \
'in the body of your migration class'
Class RegistrationsController
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Auth::RegistrationsController < Devise::RegistrationsController
include RegistrationSpamConcern
layout :determine_layout