Showing 8,229 of 8,229 total issues
Similar blocks of code found in 5 locations. Consider refactoring. Open
describe('actions', () => {
it('renders all selects', () => {
const payload = [
{
type: 'actions',
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 1319.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File Users.js
has 2523 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { ILivechatAgentStatus } from '@rocket.chat/core-typings';
import { Subscriptions } from '@rocket.chat/models';
import { escapeRegExp } from '@rocket.chat/string-helpers';
import { BaseRaw } from './BaseRaw';
File LivechatRooms.ts
has 2492 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type {
IOmnichannelRoom,
RocketChatRecordDeleted,
IOmnichannelRoomClosingInfo,
DeepWritable,
Function createSetupWSettings
has 1348 lines of code (exceeds 25 allowed). Consider refactoring. Open
settingsRegistry.addGroup('Setup_Wizard', async function () {
await this.section('Organization_Info', async function () {
await this.add('Organization_Type', '', {
type: 'select',
values: [
Function addManagementRoutes
has a Cognitive Complexity of 274 (exceeds 5 allowed). Consider refactoring. Open
addManagementRoutes() {
const orchestrator = this._orch;
const manager = this._manager;
const handleError = (message: string, e: any) => {
- 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 emojiPicker.ts
has 1943 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* This file is automatically generated from generateEmojiIndex.mjs
* Last generated Tue Apr 09 2019 15:27:21 GMT-0300 (-03)
*
* Mapping category hashes into human readable and translated names
Function addManagementRoutes
has 1017 lines of code (exceeds 25 allowed). Consider refactoring. Open
addManagementRoutes() {
const orchestrator = this._orch;
const manager = this._manager;
const handleError = (message: string, e: any) => {
File UiKitParserModal.spec.ts
has 1857 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type { OverflowElement } from '../../blocks/elements/OverflowElement';
import type { PlainText } from '../../blocks/text/PlainText';
import { BlockContext } from '../../rendering/BlockContext';
import { UiKitParserModal } from './UiKitParserModal';
import { uiKitModal } from './uiKitModal';
File UiKitParserContextualBar.spec.ts
has 1857 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type { OverflowElement } from '../../blocks/elements/OverflowElement';
import type { PlainText } from '../../blocks/text/PlainText';
import { BlockContext } from '../../rendering/BlockContext';
import { UiKitParserContextualBar } from './UiKitParserContextualBar';
import { uiKitContextualBar } from './uiKitContextualBar';
File UiKitParserBanner.spec.ts
has 1856 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type { PlainText } from '../../blocks/text/PlainText';
import { BlockContext } from '../../rendering/BlockContext';
import { UiKitParserBanner } from './UiKitParserBanner';
import { uiKitBanner } from './uiKitBanner';
File Rooms.ts
has 1675 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type {
IDirectMessageRoom,
IMessage,
IOmnichannelGenericRoom,
IRoom,
File wordList.ts
has 1635 lines of code (exceeds 250 allowed). Consider refactoring. Open
export default [
'acrobat',
'africa',
'alaska',
'albert',
UsersRaw
has 215 functions (exceeds 20 allowed). Consider refactoring. Open
export class UsersRaw extends BaseRaw {
constructor(db, trash) {
super(db, 'users', trash, {
collectionNameResolver(name) {
return name;
File Messages.ts
has 1533 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type {
ILivechatDepartment,
IMessage,
IRoom,
IUser,
File Sessions.ts
has 1508 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type {
ISession,
UserSessionAggregation,
DeviceSessionAggregation,
OSSessionAggregation,
File Subscriptions.ts
has 1466 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type {
AtLeast,
IRole,
IRoom,
ISubscription,
Similar blocks of code found in 2 locations. Consider refactoring. Open
const ChannelDeletionTable = ({ rooms, onChangeRoomSelection, selectedRooms, onToggleAllRooms }: ChannelDeletationTable) => {
const t = useTranslation();
const { sortBy, sortDirection, setSort } = useSort<'name' | 'usersCount'>('name');
const selectedRoomsLength = Object.values(selectedRooms).filter(Boolean).length;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 655.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
const ChannelDeletionTable = ({ rooms, onChangeRoomSelection, selectedRooms, onToggleAllRooms }: ChannelDeletationTable) => {
const t = useTranslation();
const { sortBy, sortDirection, setSort } = useSort<'name' | 'usersCount'>('name');
const selectedRoomsLength = Object.values(selectedRooms).filter(Boolean).length;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 655.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 5 locations. Consider refactoring. Open
describe('context', () => {
it('renders plain text', () => {
const payload = [
{
type: 'context',
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 652.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 5 locations. Consider refactoring. Open
describe('context', () => {
it('renders plain text', () => {
const payload = [
{
type: 'context',
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 652.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76