Showing 1,230 of 4,529 total issues
File notifications.js
has 557 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { IntlMessageFormat } from 'intl-messageformat';
import { defineMessages } from 'react-intl';
import { List as ImmutableList } from 'immutable';
Class Account
has 63 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Account < ApplicationRecord
self.ignored_columns += %w(
subscription_expires_at
secret
remote_url
File index.jsx
has 548 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import PropTypes from 'prop-types';
import { PureComponent } from 'react';
import { defineMessages, FormattedMessage, injectIntl } from 'react-intl';
File index.jsx
has 546 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import PropTypes from 'prop-types';
import { PureComponent } from 'react';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
File index.jsx
has 538 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import PropTypes from 'prop-types';
import { PureComponent } from 'react';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
Class Status
has 61 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Status < ApplicationRecord
include Cacheable
include Discard::Model
include Paginable
include RateLimitable
Function render
has 216 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const { account, hidden, intl } = this.props;
const { signedIn, permissions } = this.context.identity;
if (!account) {
Function loaded
has 211 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function loaded() {
const { messages: localeData } = getLocale();
const locale = document.documentElement.lang;
Function loaded
has 211 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function loaded() {
const { messages: localeData } = getLocale();
const locale = document.documentElement.lang;
Function render
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
Open
render () {
const { status, intl } = this.props;
const { signedIn, permissions } = this.context.identity;
const publicStatus = ['public', 'unlisted'].includes(status.get('visibility'));
- 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 209 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const { intl, hidden, featured, unread, showThread, scrollKey, pictureInPicture, previousId, nextInReplyToId, rootId } = this.props;
let { status, account, ...other } = this.props;
Class User
has 58 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class User < ApplicationRecord
self.ignored_columns += %w(
remember_created_at
remember_token
current_sign_in_ip
Function render
has 201 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const { account, hidden, intl } = this.props;
const { signedIn, permissions } = this.context.identity;
if (!account) {
File compose.js
has 501 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Map as ImmutableMap, List as ImmutableList, OrderedSet as ImmutableOrderedSet, fromJS } from 'immutable';
import {
COMPOSE_MOUNT,
COMPOSE_UNMOUNT,
File index.jsx
has 495 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// Package imports
import PropTypes from 'prop-types';
import { PureComponent } from 'react';
import { defineMessages, FormattedMessage, injectIntl } from 'react-intl';
File index.jsx
has 491 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import PropTypes from 'prop-types';
import { PureComponent } from 'react';
import { defineMessages, injectIntl } from 'react-intl';
File index.jsx
has 490 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import PropTypes from 'prop-types';
import { PureComponent } from 'react';
import { defineMessages, FormattedMessage, injectIntl } from 'react-intl';
File status.jsx
has 490 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import PropTypes from 'prop-types';
import { injectIntl, defineMessages, FormattedMessage } from 'react-intl';
import classNames from 'classnames';
File index.jsx
has 485 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import PropTypes from 'prop-types';
import { PureComponent } from 'react';
import { defineMessages, FormattedMessage, injectIntl } from 'react-intl';
File notifications.js
has 484 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { IntlMessageFormat } from 'intl-messageformat';
import { defineMessages } from 'react-intl';
import { List as ImmutableList } from 'immutable';