Showing 1,278 of 4,906 total issues
Method process_attachments
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def process_attachments
return [] if @object['attachment'].nil?
media_attachments = []
- 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 cc
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def cc(status)
cc = []
cc << uri_for(status.reblog.account) if status.reblog?
- 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 pluck_each
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def pluck_each(*column_names)
relation = self
options = column_names.extract_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 add
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def add(*addresses)
fail_with_message 'No IP(s) given' if addresses.empty?
skipped = 0
processed = 0
- 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 Dropdown
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const Dropdown: React.FC<DropdownProps> = ({
value,
options,
disabled,
onChange,
- 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 Dropdown
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const Dropdown: React.FC<DropdownProps> = ({
value,
options,
disabled,
onChange,
- 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 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { attachments, isLoading, hasMore, isAccount, multiColumn, suspended } = this.props;
const { width } = this.state;
if (!isAccount) {
Function render
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { accountId, accountIds, hasMore, isAccount, multiColumn, isLoading, suspended, hidden, remote, remoteUrl, hideCollections } = this.props;
if (!isAccount) {
return (
Function render
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { accountId, accountIds, hasMore, isAccount, multiColumn, isLoading, suspended, hidden, remote, remoteUrl, hideCollections } = this.props;
if (!isAccount) {
return (
Function render
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { label, limit } = this.props;
const { loading, data } = this.state;
let content;
Function render
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { components } = this.props;
let handleOpenVideo;
Function render
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { label, limit } = this.props;
const { loading, data } = this.state;
let content;
Function uploadCompose
has 46 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 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { components } = this.props;
let handleOpenVideo;
Function render
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { accountId, statusIds, featuredStatusIds, isLoading, hasMore, blockedBy, suspended, isAccount, hidden, multiColumn, remote, remoteUrl } = this.props;
if (isLoading && statusIds.isEmpty()) {
return (
Function useLinks
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useLinks = () => {
const history = useHistory();
const dispatch = useAppDispatch();
const handleHashtagClick = useCallback(
Function handleKeyDown
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
(e: React.KeyboardEvent<HTMLLIElement>) => {
const value = e.currentTarget.getAttribute('data-index');
const index = items.findIndex((item) => item.value === value);
let element: Element | null | undefined = null;
Function useLinks
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useLinks = () => {
const history = useHistory();
const dispatch = useAppDispatch();
const handleHashtagClick = useCallback(
Function handleKeyDown
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
(e: React.KeyboardEvent<HTMLLIElement>) => {
const value = e.currentTarget.getAttribute('data-index');
const index = items.findIndex((item) => item.value === value);
let element: Element | null | undefined = null;
Function render
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const { server, intl } = this.props;
const isLoading = server.get('isLoading');
return (