RocketChat/Rocket.Chat

View on GitHub

Showing 9,144 of 9,144 total issues

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

const CreateChannelModal = ({ teamId = '', onClose, reload }: CreateChannelModalProps) => {
    const t = useTranslation();
    const canSetReadOnly = usePermissionWithScopedRoles('set-readonly', ['owner']);
    const e2eEnabled = useSetting('E2E_Enable');
    const namesValidation = useSetting('UTF8_Channel_Names_Validation');
Severity: Major
Found in apps/meteor/client/sidebarv2/header/CreateChannelModal.tsx and 1 other location - About 2 wks to fix
apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx on lines 64..385

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

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

const CreateChannelModal = ({ teamId = '', onClose, reload }: CreateChannelModalProps): ReactElement => {
    const t = useTranslation();
    const canSetReadOnly = usePermissionWithScopedRoles('set-readonly', ['owner']);
    const e2eEnabled = useSetting('E2E_Enable');
    const namesValidation = useSetting('UTF8_Channel_Names_Validation');
apps/meteor/client/sidebarv2/header/CreateChannelModal.tsx on lines 64..385

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

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

File emojis.ts has 4630 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const emojis = {
    ':england:': '๐Ÿด๓ ง๓ ข๓ ฅ๓ ฎ๓ ง๓ ฟ',
    ':scotland:': '๐Ÿด๓ ง๓ ข๓ ณ๓ ฃ๓ ด๓ ฟ',
    ':wales:': '๐Ÿด๓ ง๓ ข๓ ท๓ ฌ๓ ณ๓ ฟ',
    ':men_holding_hands_medium_light_skin_tone_light_skin_tone:': '๐Ÿ‘จ๐Ÿผโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿป',
Severity: Major
Found in packages/livechat/src/lib/emoji/emojis.ts - About 1 wk to fix

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

    File omnichannel.ts has 3749 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import type {
        IOmnichannelCannedResponse,
        ILivechatAgent,
        ILivechatDepartment,
        ILivechatDepartmentAgents,
    Severity: Major
    Found in packages/rest-typings/src/v1/omnichannel.ts - About 1 wk to fix

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

      Severity
      Category
      Status
      Source
      Language