RocketChat/Rocket.Chat

View on GitHub

Showing 5,029 of 8,320 total issues

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

class TestParser extends UiKitParserModal<unknown> {
    plain_text = (element: any, context: any, index: any): any => ({
        component: 'text',
        props: {
            key: index,
Severity: Major
Found in packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts and 1 other location - About 1 wk to fix
packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts on lines 7..251

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

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

class TestParser extends UiKitParserContextualBar<unknown> {
    plain_text = (element: any, context: any, index: any): any => ({
        component: 'text',
        props: {
            key: index,
packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts on lines 7..251

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

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('section', () => {
    it('renders text as plain_text', () => {
        const payload = [
            {
                type: 'section',
packages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts on lines 221..717
packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts on lines 278..774
packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts on lines 279..775
packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts on lines 221..717

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

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('section', () => {
    it('renders text as plain_text', () => {
        const payload = [
            {
                type: 'section',
packages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts on lines 221..717
packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts on lines 278..774
packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts on lines 279..775
packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts on lines 279..775

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

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('section', () => {
    it('renders text as plain_text', () => {
        const payload = [
            {
                type: 'section',
packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts on lines 278..774
packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts on lines 279..775
packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts on lines 221..717
packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts on lines 279..775

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

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('section', () => {
    it('renders text as plain_text', () => {
        const payload = [
            {
                type: 'section',
packages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts on lines 221..717
packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts on lines 279..775
packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts on lines 221..717
packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts on lines 279..775

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

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('section', () => {
    it('renders text as plain_text', () => {
        const payload = [
            {
                type: 'section',
packages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts on lines 221..717
packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts on lines 278..774
packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts on lines 221..717
packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts on lines 279..775

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

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

class TestParser extends UiKitParserMessage<unknown> {
    plain_text = (element: any, context: any, index: any): any => ({
        component: 'text',
        props: {
            key: index,
packages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts on lines 5..193

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

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

class TestParser extends UiKitParserAttachment<unknown> {
    plain_text = (element: any, context: any, index: any): any => ({
        component: 'text',
        props: {
            key: index,
packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts on lines 5..193

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

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

describe('input', () => {
    it('renders multiline plain text input', () => {
        const payload = [
            {
                type: 'input',
packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts on lines 1377..1795
packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts on lines 1378..1796

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

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

describe('input', () => {
    it('renders multiline plain text input', () => {
        const payload = [
            {
                type: 'input',
packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts on lines 1378..1796
packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts on lines 1378..1796

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

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

describe('input', () => {
    it('renders multiline plain text input', () => {
        const payload = [
            {
                type: 'input',
packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts on lines 1377..1795
packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts on lines 1378..1796

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

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('actions', () => {
    it('renders all selects', () => {
        const payload = [
            {
                type: 'actions',
packages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts on lines 795..1143
packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts on lines 852..1200
packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts on lines 795..1143
packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts on lines 853..1201

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

Further Reading

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

describe('actions', () => {
    it('renders all selects', () => {
        const payload = [
            {
                type: 'actions',
packages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts on lines 795..1143
packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts on lines 852..1200
packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts on lines 853..1201
packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts on lines 853..1201

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

Further Reading

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

describe('actions', () => {
    it('renders all selects', () => {
        const payload = [
            {
                type: 'actions',
packages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts on lines 795..1143
packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts on lines 852..1200
packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts on lines 853..1201
packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts on lines 795..1143

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

Further Reading

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

describe('actions', () => {
    it('renders all selects', () => {
        const payload = [
            {
                type: 'actions',
packages/ui-kit/src/surfaces/banner/UiKitParserBanner.spec.ts on lines 852..1200
packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts on lines 853..1201
packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts on lines 795..1143
packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts on lines 853..1201

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

Further Reading

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

describe('actions', () => {
    it('renders all selects', () => {
        const payload = [
            {
                type: 'actions',
packages/ui-kit/src/surfaces/attachment/UiKitParserAttachment.spec.ts on lines 795..1143
packages/ui-kit/src/surfaces/contextualBar/UiKitParserContextualBar.spec.ts on lines 853..1201
packages/ui-kit/src/surfaces/message/UiKitParserMessage.spec.ts on lines 795..1143
packages/ui-kit/src/surfaces/modal/UiKitParserModal.spec.ts on lines 853..1201

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

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 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/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

Severity
Category
Status
Source
Language