Showing 1,278 of 4,906 total issues
Function statusLists
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function statusLists(state = initialState, action) {
switch(action.type) {
case FAVOURITED_STATUSES_FETCH_REQUEST:
case FAVOURITED_STATUSES_EXPAND_REQUEST:
return state.setIn(['favourites', 'isLoading'], true);
Function timelines
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function timelines(state = initialState, action) {
switch(action.type) {
case TIMELINE_LOAD_PENDING:
return state.update(action.timeline, initialTimeline, map =>
map.update('items', list => map.get('pendingItems').concat(list.take(40))).set('pendingItems', ImmutableList()).set('unread', 0));
File note_serializer.rb
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
class ActivityPub::NoteSerializer < ActivityPub::Serializer
include FormattingHelper
context_extensions :atom_uri, :conversation, :sensitive, :voters_count, :direct_message
Function render
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { label, href, target } = this.props;
const { loading, data } = this.state;
let content;
Function normalizeStatus
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function normalizeStatus(status, normalOldStatus, settings) {
const normalStatus = { ...status };
normalStatus.account = status.account.id;
if (status.reblog && status.reblog.id) {
Function render
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { signedIn } = this.props.identity;
const { location, openClosedRegistrationsModal, signupUrl, intl } = this.props;
let content;
Function render
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { label, href, target } = this.props;
const { loading, data } = this.state;
let content;
Function render
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { loading, style, intl, custom_emojis, skinTone, frequentlyUsedEmojis } = this.props;
if (loading) {
return <div style={{ width: 299 }} />;
Function render
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { signedIn } = this.props.identity;
const { location, openClosedRegistrationsModal, signupUrl, intl } = this.props;
let content;
Function createNotificationGroupFromNotificationJSON
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createNotificationGroupFromNotificationJSON(
notification: ApiNotificationJSON,
): NotificationGroup {
const group = {
sampleAccountIds: [notification.account.id],
Function createNotificationGroupFromNotificationJSON
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createNotificationGroupFromNotificationJSON(
notification: ApiNotificationJSON,
): NotificationGroup {
const group = {
sampleAccountIds: [notification.account.id],
Function uploadCompose
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function uploadCompose(files) {
return function (dispatch, getState) {
const uploadLimit = getState().getIn(['server', 'server', 'configuration', 'statuses', 'max_media_attachments']);
const media = getState().getIn(['compose', 'media_attachments']);
const pending = getState().getIn(['compose', 'pending_media_attachments']);
Function render
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { accountId, accountIds, hasMore, blockedBy, isAccount, multiColumn, isLoading, suspended, hidden, remote, remoteUrl, hideCollections } = this.props;
if (!isAccount) {
return (
Function render
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { accountId, accountIds, hasMore, blockedBy, isAccount, multiColumn, isLoading, suspended, hidden, remote, remoteUrl, hideCollections } = this.props;
if (!isAccount) {
return (
Function render
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
let closedRegistrationsMessage;
if (this.props.message) {
closedRegistrationsMessage = (
Function render
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
let closedRegistrationsMessage;
if (this.props.message) {
closedRegistrationsMessage = (
Function mapDispatchToProps
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const mapDispatchToProps = (dispatch, { contextType }) => ({
onReply (status) {
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
Function mapDispatchToProps
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const mapDispatchToProps = (dispatch, { contextType }) => ({
onReply (status) {
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 calculate_scores
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def calculate_scores(preview_cards, at_time)
items = preview_cards.map do |preview_card|
expected = preview_card.history.get(at_time - 1.day).accounts.to_f
expected = 1.0 if expected.zero?
observed = preview_card.history.get(at_time).accounts.to_f
- 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 safe_for_forwarding?
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def safe_for_forwarding?(original, compacted)
original.without('@context', 'signature').all? do |key, value|
compacted_value = compacted[key]
return false unless value.instance_of?(compacted_value.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"