Showing 1,278 of 4,906 total issues
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
Function ColumnHeader
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
export const ColumnHeader: React.FC<Props> = ({
title,
icon,
iconComponent,
active,
- 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 ColumnHeader
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
export const ColumnHeader: React.FC<Props> = ({
title,
icon,
iconComponent,
active,
- 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 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { handleChange } = this;
const { settings, item, id, inputProps, options, children, dependsOn, dependsOnNot, placeholder, disabled } = this.props;
let enabled = !disabled;
File notifications.js
has 294 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { fromJS, Map as ImmutableMap, List as ImmutableList } from 'immutable';
import { blockDomainSuccess } from 'flavours/glitch/actions/domain_blocks';
import { timelineDelete } from 'flavours/glitch/actions/timelines_typed';
File index.tsx
has 294 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { useCallback, useEffect, useMemo, useRef } from 'react';
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
import { Helmet } from 'react-helmet';
File index.tsx
has 294 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { useCallback, useEffect, useMemo, useRef } from 'react';
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
import { Helmet } from 'react-helmet';
File media_gallery.jsx
has 293 lines of code (exceeds 250 allowed). Consider refactoring. Open
import PropTypes from 'prop-types';
import { PureComponent } from 'react';
import { FormattedMessage } from 'react-intl';
File profile.tsx
has 293 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { useState, useMemo, useCallback, createRef } from 'react';
import { useIntl, defineMessages, FormattedMessage } from 'react-intl';
import classNames from 'classnames';
File profile.tsx
has 293 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { useState, useMemo, useCallback, createRef } from 'react';
import { useIntl, defineMessages, FormattedMessage } from 'react-intl';
import classNames from 'classnames';
File inline_follow_suggestions.tsx
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { useEffect, useCallback, useRef, useState } from 'react';
import { FormattedMessage, useIntl, defineMessages } from 'react-intl';
import { Link } from 'react-router-dom';
File inline_follow_suggestions.tsx
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { useEffect, useCallback, useRef, useState } from 'react';
import { FormattedMessage, useIntl, defineMessages } from 'react-intl';
import { Link } from 'react-router-dom';
Function emojifyTextNode
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
const emojifyTextNode = (node, customEmojis) => {
const VS15 = 0xFE0E;
const VS16 = 0xFE0F;
let str = node.textContent;
Function emojifyTextNode
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
const emojifyTextNode = (node, customEmojis) => {
const VS15 = 0xFE0E;
const VS16 = 0xFE0F;
let str = node.textContent;
Class AccountSerializer
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class REST::AccountSerializer < ActiveModel::Serializer
include RoutingHelper
include FormattingHelper
# Please update `app/javascript/mastodon/api_types/accounts.ts` when making changes to the attributes
File dropdown_menu.jsx
has 291 lines of code (exceeds 250 allowed). Consider refactoring. Open
import PropTypes from 'prop-types';
import { PureComponent, cloneElement, Children } from 'react';
import classNames from 'classnames';
import { withRouter } from 'react-router-dom';
File dropdown_menu.jsx
has 291 lines of code (exceeds 250 allowed). Consider refactoring. Open
import PropTypes from 'prop-types';
import { PureComponent, cloneElement, Children } from 'react';
import classNames from 'classnames';
import { withRouter } from 'react-router-dom';
Function submitCompose
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function submitCompose() {
return function (dispatch, getState) {
const status = getState().getIn(['compose', 'text'], '');
const media = getState().getIn(['compose', 'media_attachments']);
const statusId = getState().getIn(['compose', 'id'], null);
Function setupMetrics
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function setupMetrics(channels, pgPool) {
// Collect metrics from Node.js
metrics.collectDefaultMetrics();
new metrics.Gauge({
Method remove_orphans
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
def remove_orphans
progress = create_progress_bar(nil)
reclaimed_bytes = 0
removed = 0
prefix = options[:prefix]