Showing 1,278 of 4,906 total issues
Class PostStatusService
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class PostStatusService < BaseService
include Redisable
include LanguagesHelper
class UnexpectedMentionsError < StandardError
Class BaseMeasure
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Admin::Metrics::Measure::BaseMeasure
CACHE_TTL = 5.minutes.freeze
def self.with_params?
false
Class StatusParser
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class ActivityPub::Parser::StatusParser
include JsonLdHelper
NORMALIZED_LOCALE_NAMES = LanguagesHelper::SUPPORTED_LOCALES.keys.index_by(&:downcase).freeze
Function render
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { index, intl, onClose, onNavigate } = this.props;
return (
Method deploy
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def deploy
verify_deploy_options!
indices = if options[:only]
options[:only].map { |str| "#{str.camelize}Index".constantize }
Function render
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { account } = this.props;
if (account.get('suspended')) {
return (
Function getData
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getData(emoji, skin, set) {
let emojiData = {};
if (typeof emoji === 'string') {
let matches = emoji.match(COLONS_REGEX);
Function render
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { attachments, isLoading, hasMore, isAccount, multiColumn, blockedBy, suspended } = this.props;
const { width } = this.state;
if (!isAccount) {
Function getData
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getData(emoji, skin, set) {
let emojiData = {};
if (typeof emoji === 'string') {
let matches = emoji.match(COLONS_REGEX);
Function notifications
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function notifications(state = initialState, action) {
switch(action.type) {
case fetchMarkers.fulfilled.type:
return action.payload.markers.notifications ? recountUnread(state, action.payload.markers.notifications.last_read_id) : state;
case NOTIFICATIONS_MOUNT:
Method merge_with!
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def merge_with!(other_account)
# Since it's the same remote resource, the remote resource likely
# already believes we are following/blocking, so it's safe to
# re-attribute the relationships too. However, during the presence
# of the index bug users could have *also* followed the reference
Method open
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def open(host, *args)
outer_e = nil
port = args.first
addresses = [] # rubocop:disable Lint/UselessAssignment # TODO: https://github.com/rubocop/rubocop/issues/13395
Function relationshipsReducer
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const relationshipsReducer: Reducer<State> = (
state = initialState,
action,
) => {
if (authorizeFollowRequestSuccess.match(action))
Function relationshipsReducer
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const relationshipsReducer: Reducer<State> = (
state = initialState,
action,
) => {
if (authorizeFollowRequestSuccess.match(action))
Method call
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def call(status, **options)
@payload = Oj.dump(event: :delete, payload: status.id.to_s)
@status = status
@account = status.account
@options = options
- 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 validate_each
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def validate_each(record, attribute, value)
return if value.blank?
(options[:multiline] ? value.split : [value]).each do |domain|
_, domain = domain.split('@') if options[:acct]
- 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 open
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def open(host, *args)
outer_e = nil
port = args.first
addresses = [] # rubocop:disable Lint/UselessAssignment # TODO: https://github.com/rubocop/rubocop/issues/13395
- 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 to
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def to(status)
case status.visibility
when 'public'
[COLLECTIONS[:public]]
when 'unlisted', 'private'
- 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 call
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def call(recipient, type, activity)
return if recipient.user.nil?
@recipient = recipient
@activity = activity
- 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 useLinks
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export const useLinks = () => {
const history = useHistory();
const dispatch = useAppDispatch();
const handleHashtagClick = useCallback(
- 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"