Showing 793 of 1,813 total issues
Function mapDispatchToProps
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
const mapDispatchToProps = (dispatch, { intl }) => ({
onReply (status, router) {
dispatch((_, getState) => {
let state = getState();
- 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 update_column_in_batches
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def update_column_in_batches(table_name, column, value)
if transaction_open?
raise 'update_column_in_batches can not be run inside a transaction, ' \
'you can disable transactions by calling disable_ddl_transaction! ' \
'in the body of your migration class'
- 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 parallelize_with_progress
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def parallelize_with_progress(scope)
if options[:concurrency] < 1
say('Cannot run with this concurrency setting, must be at least 1', :red)
exit(1)
end
- 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 emoji_picker_dropdown.jsx
has 343 lines of code (exceeds 250 allowed). Consider refactoring. Open
import PropTypes from 'prop-types';
import { PureComponent } from 'react';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
Function render
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { src, intl, alt, lang, editable, autoPlay, sensitive, blurhash } = this.props;
const { paused, volume, currentTime, duration, buffer, dragging, revealed } = this.state;
const progress = Math.min((currentTime / duration) * 100, 100);
const muted = this.state.muted || volume === 0;
Function getData
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
function getData(emoji, skin, set) {
let emojiData = {};
if (typeof emoji === 'string') {
let matches = emoji.match(COLONS_REGEX);
- 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 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { media, statusId, lang, intl, onClose } = this.props;
const { navigationHidden } = this.state;
const index = this.getIndex();
Function render
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { router } = this.context;
const { title, icon, active, children, pinned, multiColumn, extraButton, showBackButton, intl: { formatMessage }, placeholder, appendContent, collapseIssues } = this.props;
const { collapsed, animating } = this.state;
File index.jsx
has 334 lines of code (exceeds 250 allowed). Consider refactoring. Open
import PropTypes from 'prop-types';
import React from 'react';
import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
Status
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
class Status extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,
};
Class Maintenance
has 32 methods (exceeds 20 allowed). Consider refactoring. Open
class Maintenance < Base
MIN_SUPPORTED_VERSION = 2019_10_01_213028
MAX_SUPPORTED_VERSION = 2023_09_07_150100
# Stubs to enjoy ActiveRecord queries while not depending on a particular
Function render
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { card } = this.props;
const { embedded, revealed } = this.state;
if (card === null) {
Function render
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { attachment, lang, index, size, standalone, displayWidth, visible } = this.props;
let badges = [], thumbnail;
Function mapDispatchToProps
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
const mapDispatchToProps = (dispatch, { intl }) => ({
onFollow (account) {
if (account.getIn(['relationship', 'following'])) {
if (unfollowModal) {
- 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 LinkDetailsExtractor
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
class LinkDetailsExtractor
include ActionView::Helpers::TagHelper
include LanguagesHelper
# Some publications wrap their JSON-LD data in their <script> tags
Function render
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { status, relationship, intl } = this.props;
const { signedIn, permissions } = this.context.identity;
const publicStatus = ['public', 'unlisted'].includes(status.get('visibility'));
Function render
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
let ancestors, descendants;
const { isLoading, status, ancestorsIds, descendantsIds, intl, domain, multiColumn, pictureInPicture } = this.props;
const { fullscreen } = this.state;
Function userLists
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function userLists(state = initialState, action) {
switch(action.type) {
case FOLLOWERS_FETCH_SUCCESS:
return normalizeList(state, ['followers', action.id], action.accounts, action.next);
case FOLLOWERS_EXPAND_SUCCESS:
File user.rb
has 325 lines of code (exceeds 250 allowed). Consider refactoring. Open
class User < ApplicationRecord
self.ignored_columns += %w(
remember_created_at
remember_token
current_sign_in_ip
Method remove_orphans
has 95 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]