Showing 1,287 of 4,903 total issues
Class DeleteAccountService
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
class DeleteAccountService < BaseService
include Payloadable
ASSOCIATIONS_ON_SUSPEND = %w(
account_notes
File media_attachment.rb
has 319 lines of code (exceeds 250 allowed). Consider refactoring. Open
class MediaAttachment < ApplicationRecord
self.inheritance_column = nil
include Attachmentable
Function render
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { loading, data } = this.state;
const { frequency } = this.props;
let content;
Function render
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { loading, data } = this.state;
const { frequency } = this.props;
let content;
File create.rb
has 317 lines of code (exceeds 250 allowed). Consider refactoring. Open
class ActivityPub::Activity::Create < ActivityPub::Activity
include FormattingHelper
def perform
@account.schedule_refresh_if_stale!
File search.jsx
has 316 lines of code (exceeds 250 allowed). Consider refactoring. Open
import PropTypes from 'prop-types';
import { PureComponent } from 'react';
import { defineMessages, injectIntl, FormattedMessage, FormattedList } from 'react-intl';
File search.jsx
has 316 lines of code (exceeds 250 allowed). Consider refactoring. Open
import PropTypes from 'prop-types';
import { PureComponent } from 'react';
import { defineMessages, injectIntl, FormattedMessage, FormattedList } from 'react-intl';
Function render
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
render () {
const { attachment, lang, index, size, standalone, letterbox, displayWidth, visible } = this.props;
let badges = [], thumbnail;
- 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 MediaItem
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
}> = ({ attachment, onOpenMedia }) => {
const [visible, setVisible] = useState(
(displayMedia !== 'hide_all' &&
!attachment.getIn(['status', 'sensitive'])) ||
displayMedia === 'show_all',
- 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 timeAgoString
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
export const timeAgoString = (
intl: Pick<IntlShape, 'formatDate' | 'formatMessage'>,
date: Date,
now: number,
year: number,
- 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 MediaItem
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
}> = ({ attachment, onOpenMedia }) => {
const [visible, setVisible] = useState(
(displayMedia !== 'hide_all' &&
!attachment.getIn(['status', 'sensitive'])) ||
displayMedia === 'show_all',
- 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 timeAgoString
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
export const timeAgoString = (
intl: Pick<IntlShape, 'formatDate' | 'formatMessage'>,
date: Date,
now: number,
year: number,
- 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 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { status, intl } = this.props;
const { signedIn, permissions } = this.props.identity;
const publicStatus = ['public', 'unlisted'].includes(status.get('visibility'));
File admin.tsx
has 315 lines of code (exceeds 250 allowed). Consider refactoring. Open
import '@/entrypoints/public-path';
import { createRoot } from 'react-dom/client';
import Rails from '@rails/ujs';
File admin.tsx
has 315 lines of code (exceeds 250 allowed). Consider refactoring. Open
import './public-path';
import { createRoot } from 'react-dom/client';
import Rails from '@rails/ujs';
File statuses.js
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { browserHistory } from 'flavours/glitch/components/router';
import api from '../api';
import { ensureComposeIsVisible, setComposeToStatus } from './compose';
File statuses.js
has 312 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { browserHistory } from 'mastodon/components/router';
import api from '../api';
import { ensureComposeIsVisible, setComposeToStatus } from './compose';
Function render
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const {
accountId,
account,
intl,
Function render
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { intl, onPaste, autoFocus, withoutNavigation, maxChars } = this.props;
const { highlighted } = this.state;
const disabled = this.props.isSubmitting;
Function render
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const {
accountId,
account,
intl,