Showing 720 of 1,785 total issues
Class MaintenanceCLI
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class MaintenanceCLI < Thor
include CLIHelper
def self.exit_on_failure?
true
Class ActorSerializer
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class ActivityPub::ActorSerializer < ActivityPub::Serializer
include RoutingHelper
include FormattingHelper
context :security
Function render
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { intl, results, suggestions, dismissSuggestion, searchTerm } = this.props;
if (searchTerm === '' && !suggestions.isEmpty()) {
return (
Function render
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { intl, notifications, isLoading, isUnread, columnId, multiColumn, hasMore, numPending, showFilterBar, lastReadId, canMarkAsRead, needsNotificationPermission } = this.props;
const pinned = !!columnId;
const emptyMessage = <FormattedMessage id='empty_column.notifications' defaultMessage="You don't have any notifications yet. When other people interact with you, you will see it here." />;
File dropdown_menu.js
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import IconButton from './icon_button';
import Overlay from 'react-overlays/lib/Overlay';
Function mapDispatchToProps
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
const mapDispatchToProps = (dispatch, { intl }) => ({
onFollow (account) {
if (account.getIn(['relationship', 'following']) || account.getIn(['relationship', 'requested'])) {
if (unfollowModal) {
- 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 parallelize_with_progress
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def parallelize_with_progress(scope)
if options[:concurrency] < 1
say('Cannot run with this concurrency setting, must be at least 1', :red)
exit(1)
end
- 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
ScrollableList
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
export default @connect(mapStateToProps, null, null, { forwardRef: true })
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
def call(recipient, type, activity)
@recipient = recipient
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
Function render
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
render () {
const { preview, src, inline, onOpenVideo, onCloseVideo, intl, alt, detailed, sensitive, editable, blurhash } = this.props;
const { quote } = this.props;
// const { preview, src, inline, onOpenVideo, onCloseVideo, intl, alt, detailed, sensitive, link, editable, blurhash, quote } = this.props;
const { containerWidth, currentTime, duration, volume, buffer, dragging, paused, fullscreen, hovered, muted, revealed } = this.state;
- 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
Method refresh
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def refresh
dry_run = options[:dry_run] ? ' (DRY RUN)' : ''
if options[:status]
scope = MediaAttachment.where(status_id: options[:status])
- 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 scrollable_list.js
has 295 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { PureComponent } from 'react';
import ScrollContainer from 'mastodon/containers/scroll_container';
import PropTypes from 'prop-types';
import IntersectionObserverArticleContainer from '../containers/intersection_observer_article_container';
import LoadMore from './load_more';
File lists.js
has 294 lines of code (exceeds 250 allowed). Consider refactoring. Open
import api from '../api';
import { importFetchedAccounts } from './importer';
import { showAlertForError } from './alerts';
export const LIST_FETCH_REQUEST = 'LIST_FETCH_REQUEST';
Function render
has 75 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 MediaAttachment
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class MediaAttachment < ApplicationRecord
self.inheritance_column = nil
include Attachmentable
Class PostStatusService
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class PostStatusService < BaseService
include Redisable
include LanguagesHelper
MIN_SCHEDULE_OFFSET = 5.minutes.freeze
Class FeedManager
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class FeedManager
include Singleton
include Redisable
# Maximum number of items stored in a single feed
Function render
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { intl, onPaste, showSearch } = this.props;
const disabled = this.props.isSubmitting;
let publishText = '';