Showing 1,278 of 4,906 total issues
Notification
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Notification extends ImmutablePureComponent {
static propTypes = {
notification: ImmutablePropTypes.map.isRequired,
hidden: PropTypes.bool,
onMoveUp: PropTypes.func.isRequired,
Class AccountsController
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class AccountsController < BaseController
before_action :set_account, except: [:index, :batch]
before_action :require_remote_account!, only: [:redownload]
before_action :require_local_account!, only: [:enable, :memorialize, :approve, :reject]
Class Request
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Request
REQUEST_TARGET = '(request-target)'
# We enforce a 5s timeout on DNS resolving, 5s timeout on socket opening
# and 5s timeout on the TLS handshake, meaning the worst case should take
Class FanOutOnWriteService
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class FanOutOnWriteService < BaseService
include Redisable
# Push a status into home and mentions feeds
# @param [Status] status
Class UserMailer
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class UserMailer < Devise::Mailer
layout 'mailer'
helper :accounts
helper :application
Class StatusSerializer
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class REST::StatusSerializer < ActiveModel::Serializer
include FormattingHelper
# Please update `app/javascript/mastodon/api_types/statuses.ts` when making changes to the attributes
Function render
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const { id, options, children, placeholder, value } = this.props;
if (options && options.length > 0) {
const currentValue = value;
Function render
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const { statusIds, featuredStatusIds, onLoadMore, timelineId, ...other } = this.props;
const { isLoading, isPartial } = other;
if (isPartial) {
Function computeHashtagBarForStatus
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function computeHashtagBarForStatus(status: StatusLike): {
statusContentProps: { statusContent: string };
hashtagsInBar: string[];
} {
let statusContent = getStatusContent(status);
Function computeHashtagBarForStatus
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function computeHashtagBarForStatus(status: StatusLike): {
statusContentProps: { statusContent: string };
hashtagsInBar: string[];
} {
let statusContent = getStatusContent(status);
Function PictureInPicture
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const PictureInPicture: React.FC = () => {
const dispatch = useAppDispatch();
const handleClose = useCallback(() => {
dispatch(removePictureInPicture());
File column_header.tsx
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { useCallback, useState } from 'react';
import { FormattedMessage, defineMessages, useIntl } from 'react-intl';
import classNames from 'classnames';
File column_header.tsx
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { useCallback, useState } from 'react';
import { FormattedMessage, defineMessages, useIntl } from 'react-intl';
import classNames from 'classnames';
Function render
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const { statusIds, featuredStatusIds, onLoadMore, timelineId, ...other } = this.props;
const { isLoading, isPartial } = other;
if (isPartial) {
Function createNotificationGroupFromJSON
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function createNotificationGroupFromJSON(
groupJson: ApiNotificationGroupJSON,
): NotificationGroup {
const { sample_account_ids: sampleAccountIds, ...group } = groupJson;
Function createNotificationGroupFromJSON
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function createNotificationGroupFromJSON(
groupJson: ApiNotificationGroupJSON,
): NotificationGroup {
const { sample_account_ids: sampleAccountIds, ...group } = groupJson;
File new.tsx
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { useCallback, useState, useEffect } from 'react';
import { defineMessages, useIntl, FormattedMessage } from 'react-intl';
import { Helmet } from 'react-helmet';
File new.tsx
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { useCallback, useState, useEffect } from 'react';
import { defineMessages, useIntl, FormattedMessage } from 'react-intl';
import { Helmet } from 'react-helmet';
Function normalizeStatus
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
export function normalizeStatus(status, normalOldStatus, settings) {
const normalStatus = { ...status };
normalStatus.account = status.account.id;
if (status.reblog && status.reblog.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 request_review!
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
def self.request_review!
return if skip_review? || !enabled?
links_requiring_review = links.request_review
tags_requiring_review = tags.request_review
- 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"