Showing 720 of 1,785 total issues
Function startWorker
has 730 lines of code (exceeds 25 allowed). Consider refactoring. Open
const startWorker = async (workerId) => {
log.warn(`Starting worker ${workerId}`);
const pgConfigs = {
development: {
Function startWorker
has a Cognitive Complexity of 136 (exceeds 5 allowed). Consider refactoring. Open
const startWorker = async (workerId) => {
log.warn(`Starting worker ${workerId}`);
const pgConfigs = {
development: {
- 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 a Cognitive Complexity of 115 (exceeds 5 allowed). Consider refactoring. Open
render () {
const { attachment, index, size, standalone, displayWidth, visible } = this.props;
let width = 50;
let height = 100;
- 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 index.js
has 853 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @ts-check
const os = require('os');
const throng = require('throng');
const dotenv = require('dotenv');
Function render
has 324 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
let media = null;
let statusAvatar, prepend, rebloggedByText, unlistedQuoteText;
const { intl, hidden, featured, unread, showThread, scrollKey, pictureInPicture, contextType } = this.props;
File accounts.js
has 655 lines of code (exceeds 250 allowed). Consider refactoring. Open
import api, { getLinks } from '../api';
import { importFetchedAccount, importFetchedAccounts } from './importer';
export const ACCOUNT_FETCH_REQUEST = 'ACCOUNT_FETCH_REQUEST';
export const ACCOUNT_FETCH_SUCCESS = 'ACCOUNT_FETCH_SUCCESS';
File compose.js
has 646 lines of code (exceeds 250 allowed). Consider refactoring. Open
import api from '../api';
import { CancelToken, isCancel } from 'axios';
import { throttle } from 'lodash';
import { search as emojiSearch } from '../features/emoji/emoji_mart_search_light';
import { tagHistory } from '../settings';
Method remove_orphans
has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring. Open
def remove_orphans
progress = create_progress_bar(nil)
reclaimed_bytes = 0
removed = 0
dry_run = options[:dry_run] ? ' (DRY RUN)' : ''
- 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 status.js
has 617 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import Avatar from './avatar';
import AvatarOverlay from './avatar_overlay';
Function search
has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring. Open
function search(value, { emojisToShowFilter, maxResults, include, exclude, custom } = {}) {
if (custom !== undefined) {
if (customEmojisList !== custom)
addCustomToPool(custom, originalPool);
} else {
- 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 compose
has 262 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function compose(state = initialState, action) {
switch(action.type) {
case STORE_HYDRATE:
return hydrate(state, action.state.get('compose'));
case COMPOSE_MOUNT:
Function render
has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring. Open
render () {
const { account, hidden, intl, domain } = this.props;
if (!account) {
return null;
- 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
Class Status
has 67 methods (exceeds 20 allowed). Consider refactoring. Open
class Status < ApplicationRecord
before_destroy :unlink_from_conversations
include Discard::Model
include Paginable
Class Account
has 66 methods (exceeds 20 allowed). Consider refactoring. Open
class Account < ApplicationRecord
self.ignored_columns = %w(
subscription_expires_at
secret
remote_url
Function render
has 239 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { attachment, index, size, standalone, displayWidth, visible } = this.props;
let width = 50;
let height = 100;
Class User
has 64 methods (exceeds 20 allowed). Consider refactoring. Open
class User < ApplicationRecord
self.ignored_columns = %w(
remember_created_at
remember_token
current_sign_in_ip
File index.js
has 550 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Immutable from 'immutable';
import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import classNames from 'classnames';
Function render
has 225 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const status = (this.props.status && this.props.status.get('reblog')) ? this.props.status.get('reblog') : this.props.status;
const outerStyle = { boxSizing: 'border-box' };
const { intl, compact, pictureInPicture } = this.props;
File index.js
has 541 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import PropTypes from 'prop-types';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { is } from 'immutable';
import { throttle, debounce } from 'lodash';
File compose.js
has 530 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
COMPOSE_MOUNT,
COMPOSE_UNMOUNT,
COMPOSE_CHANGE,
COMPOSE_REPLY,