RocketChat/Rocket.Chat

View on GitHub

Showing 4,961 of 8,229 total issues

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;
apps/meteor/client/views/teams/contextualBar/info/DeleteTeam/ChannelDeletionTable/ChannelDeletionTable.tsx on lines 17..76

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

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

describe('context', () => {
    it('renders plain text', () => {
        const payload = [
            {
                type: 'context',
packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts on lines 1202..1375
packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts on lines 1203..1376
packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts on lines 1145..1318
packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts on lines 1203..1376

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

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

describe('context', () => {
    it('renders plain text', () => {
        const payload = [
            {
                type: 'context',
Severity: Major
Found in packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts and 4 other locations - About 3 days to fix
packages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts on lines 1145..1318
packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts on lines 1202..1375
packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts on lines 1203..1376
packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts on lines 1145..1318

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

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

describe('context', () => {
    it('renders plain text', () => {
        const payload = [
            {
                type: 'context',
Severity: Major
Found in packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts and 4 other locations - About 3 days to fix
packages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts on lines 1145..1318
packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts on lines 1203..1376
packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts on lines 1145..1318
packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts on lines 1203..1376

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

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

describe('context', () => {
    it('renders plain text', () => {
        const payload = [
            {
                type: 'context',
packages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts on lines 1145..1318
packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts on lines 1202..1375
packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts on lines 1203..1376
packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts on lines 1203..1376

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

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

describe('context', () => {
    it('renders plain text', () => {
        const payload = [
            {
                type: 'context',
packages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts on lines 1145..1318
packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts on lines 1202..1375
packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts on lines 1145..1318
packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts on lines 1203..1376

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

describe('prerelease version', () => {
    it('should not suggest available version the highest version is a prerelease from a different tag', () => {
        const status = getVersionStatus('3.0.0', [
            {
                version: '3.0.0',
apps/meteor/client/lib/VideoConfManager.ts on lines 581..586

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 611.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export const findWeeklyUsersRegisteredData = async ({
    start,
    end,
}: {
    start: Date;
Severity: Major
Found in apps/meteor/ee/server/lib/engagementDashboard/users.ts and 1 other location - About 3 days to fix
apps/meteor/ee/server/lib/engagementDashboard/messages.ts on lines 58..108

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 572.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export const findWeeklyMessagesSentData = async ({
    start,
    end,
}: {
    start: Date;
Severity: Major
Found in apps/meteor/ee/server/lib/engagementDashboard/messages.ts and 1 other location - About 3 days to fix
apps/meteor/ee/server/lib/engagementDashboard/users.ts on lines 43..90

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 572.

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

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    async Avg_reaction_time(from: moment.Moment, to: moment.Moment, departmentId?: string, extraQuery: Filter<IOmnichannelRoom> = {}) {
        const agentAvgReactionTime = new Map(); // stores avg reaction time for each agent
        const date = {
            gte: from.toDate(),
            lt: to.add(1, 'days').toDate(),
apps/meteor/server/services/omnichannel-analytics/AgentData.ts on lines 219..267
apps/meteor/server/services/omnichannel-analytics/AgentData.ts on lines 311..359

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 463.

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

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    async Avg_response_time(from: moment.Moment, to: moment.Moment, departmentId?: string, extraQuery: Filter<IOmnichannelRoom> = {}) {
        const agentAvgRespTime = new Map(); // stores avg response time for each agent
        const date = {
            gte: from.toDate(),
            lt: to.add(1, 'days').toDate(),
apps/meteor/server/services/omnichannel-analytics/AgentData.ts on lines 219..267
apps/meteor/server/services/omnichannel-analytics/AgentData.ts on lines 361..409

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 463.

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

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    async Avg_first_response_time(from: moment.Moment, to: moment.Moment, departmentId?: string, extraQuery: Filter<IOmnichannelRoom> = {}) {
        const agentAvgRespTime = new Map(); // stores avg response time for each agent
        const date = {
            gte: from.toDate(),
            lt: to.add(1, 'days').toDate(),
apps/meteor/server/services/omnichannel-analytics/AgentData.ts on lines 311..359
apps/meteor/server/services/omnichannel-analytics/AgentData.ts on lines 361..409

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 463.

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

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

describe('conditional', () => {
    it('renders when conditions match', () => {
        const blocks = [
            {
                type: 'conditional',
packages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts on lines 1320..1427
packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts on lines 1797..1904
packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts on lines 1798..1905
packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts on lines 1798..1905

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 422.

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

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

describe('conditional', () => {
    it('renders when conditions match', () => {
        const blocks = [
            {
                type: 'conditional',
packages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts on lines 1320..1427
packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts on lines 1797..1904
packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts on lines 1320..1427
packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts on lines 1798..1905

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 422.

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

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

describe('conditional', () => {
    it('renders when conditions match', () => {
        const blocks = [
            {
                type: 'conditional',
Severity: Major
Found in packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts and 4 other locations - About 2 days to fix
packages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts on lines 1320..1427
packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts on lines 1797..1904
packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts on lines 1798..1905
packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts on lines 1320..1427

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 422.

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

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

describe('conditional', () => {
    it('renders when conditions match', () => {
        const blocks = [
            {
                type: 'conditional',
Severity: Major
Found in packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts and 4 other locations - About 2 days to fix
packages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts on lines 1320..1427
packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts on lines 1798..1905
packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts on lines 1320..1427
packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts on lines 1798..1905

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 422.

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

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

describe('conditional', () => {
    it('renders when conditions match', () => {
        const blocks = [
            {
                type: 'conditional',
packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts on lines 1797..1904
packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts on lines 1798..1905
packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts on lines 1320..1427
packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts on lines 1798..1905

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 422.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

API.v1.addRoute(
    'channels.list.joined',
    { authRequired: true },
    {
        async get() {
Severity: Major
Found in apps/meteor/app/api/server/v1/channels.ts and 1 other location - About 2 days to fix
apps/meteor/app/api/server/v1/groups.ts on lines 632..669

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 377.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

API.v1.addRoute(
    'groups.list',
    { authRequired: true },
    {
        async get() {
Severity: Major
Found in apps/meteor/app/api/server/v1/groups.ts and 1 other location - About 2 days to fix
apps/meteor/app/api/server/v1/channels.ts on lines 1011..1048

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 377.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                        <Field>
                            <FieldLabel htmlFor={departmentsField} required>
                                {t('Departments')}
                            </FieldLabel>
                            <FieldRow>
Severity: Major
Found in apps/meteor/ee/client/omnichannel/units/UnitEdit.tsx and 1 other location - About 2 days to fix
apps/meteor/ee/client/omnichannel/units/UnitEdit.tsx on lines 254..293

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 364.

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

Further Reading

Severity
Category
Status
Source
Language