Showing 720 of 1,785 total issues
Method perform
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def perform(account_id, target_account_uri, relationship, options)
from_account = Account.find(account_id)
target_domain = domain(target_account_uri)
target_account = stoplight_wrap_request(target_domain) { ResolveAccountService.new.call(target_account_uri, { check_delivery_availability: true }) }
options.symbolize_keys!
- 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 filter_map
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def filter_map
if block_given?
result = []
each do |element|
res = yield element
- 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 make
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def make
depth = 8
# Determine background palette by getting colors close to the image's edge only
background_palette = palette_from_histogram(convert(':source -alpha set -gravity Center -region 75%x75% -fill None -colorize 100% -alpha transparent +region -format %c -colors :quantity -depth :depth histogram:info:', source: File.expand_path(@file.path), quantity: 10, depth: depth), 10)
- 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 perform_request
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def perform_request(uri, headers: nil)
return if invalid_origin?(uri)
req = Request.new(:get, uri)
- 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 makeGetStatus
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const makeGetStatus = () => {
return createSelector(
[
(state, { id }) => state.getIn(['statuses', id]),
(state, { id }) => state.getIn(['statuses', state.getIn(['statuses', id, 'reblog'])]),
Function render
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { status, intl, withOpenButton } = this.props;
if (status === null) return null
Method process_remote_attachments
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process_remote_attachments
# IMAGE: [https://s3.mashiro.top/view/2022/02/24/6f3f209aa55e3083f0659ecb62448fc0.jpg]
image_array = @text.scan(/IMAGE:\s*\[\s*((?:https|http):\/\/.+?)\s*\](?:\s*\{\s*((?:https|http):\/\/.+?)\s*\})*/)
video_array = @text.scan(/VIDEO:\s*\[\s*((?:https|http):\/\/.+?)\s*\](?:\s*\{\s*((?:https|http):\/\/.+?)\s*\})*/)
Function synchronouslySubmitMarkers
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const synchronouslySubmitMarkers = () => (dispatch, getState) => {
const accessToken = getState().getIn(['meta', 'access_token'], '');
const params = _buildParams(getState());
if (Object.keys(params).length === 0) {
Function stringFromCodePoint
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const stringFromCodePoint = _String.fromCodePoint || function () {
let MAX_SIZE = 0x4000;
let codeUnits = [];
let highSurrogate;
let lowSurrogate;
Function render
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { limit } = this.props;
const { loading, data } = this.state;
let content;
Function searchValue
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const searchValue = (value) => {
let aPool = pool,
aIndex = index,
length = 0;
Function getTicks
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
getTicks (count, size, radius, scaleCoefficient) {
const ticks = this.getTickPoints(count);
const lesser = 200;
const m = [];
const bufferLength = this.analyser ? this.analyser.frequencyBinCount : 0;
Function render
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { category, startedFrom, rules, intl } = this.props;
const options = rules.size > 0 ? [
'dislike',
Function render
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { account, hidden, hideTabs } = this.props;
if (account === null) {
return null;
Method make
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def make
metadata = VideoMetadataExtractor.new(@file.path)
unless metadata.valid?
Paperclip.log("Unsupported file #{@file.path}")
Method add
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add(*domains)
if domains.empty?
say('No domain(s) given', :red)
exit(1)
end
Method remove_orphans_conversations
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def remove_orphans_conversations
start_at = Time.now.to_f
unless options[:continue] && ActiveRecord::Base.connection.table_exists?('conversations_to_be_deleted')
say('Creating temporary database indices...')
Function _updateStatusLinks
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
_updateStatusLinks () {
const node = this.node;
if (!node) {
return;
Function render
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, children } = this.props;
const { suggestionsHidden } = this.state;
return [
Function render
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { announcements, intl } = this.props;
const { index } = this.state;
if (announcements.isEmpty()) {