wahanegi/vibereport

View on GitHub
app/javascript/components/__tests__/RichInputElement.test.js

Summary

Maintainability
F
5 days
Test Coverage

File RichInputElement.test.js has 564 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
  import { render, fireEvent , screen } from '@testing-library/react';
import RichInputElement from "../UI/rich-text/RichInputElement";
import Cursor from "../UI/rich-text/cursor";
import  RichText  from "../UI/rich-text/rich-text"
Severity: Major
Found in app/javascript/components/__tests__/RichInputElement.test.js - About 1 day to fix

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

          expect(setChosenUsersMock).toHaveBeenCalledWith(
              [{id: 1, first_name: 'George', last_name: 'Washington'},
                {id: 2, first_name: 'Jackie', last_name: 'Chan'},
                {id: 3, first_name: 'Janice', last_name: 'Wednesday'},
                {id: 9, first_name: 'roger', last_name: ''},
    app/javascript/components/__tests__/RichInputElement.test.js on lines 262..268
    app/javascript/components/__tests__/RichInputElement.test.js on lines 288..294
    app/javascript/components/__tests__/RichInputElement.test.js on lines 344..350

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

    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 4 locations. Consider refactoring.
    Open

          expect(setChosenUsersMock).toHaveBeenCalledWith(
              [{id: 1, first_name: 'George', last_name: 'Washington'},
                {id: 2, first_name: 'Jackie', last_name: 'Chan'},
                {id: 3, first_name: 'Janice', last_name: 'Wednesday'},
                {id: 9, first_name: 'roger', last_name: ''},
    app/javascript/components/__tests__/RichInputElement.test.js on lines 262..268
    app/javascript/components/__tests__/RichInputElement.test.js on lines 314..320
    app/javascript/components/__tests__/RichInputElement.test.js on lines 344..350

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

    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 4 locations. Consider refactoring.
    Open

          expect(setChosenUsersMock).toHaveBeenCalledWith(
              [{id: 1, first_name: 'George', last_name: 'Washington'},
                {id: 2, first_name: 'Jackie', last_name: 'Chan'},
                {id: 3, first_name: 'Janice', last_name: 'Wednesday'},
                {id: 9, first_name: 'roger', last_name: ''},
    app/javascript/components/__tests__/RichInputElement.test.js on lines 262..268
    app/javascript/components/__tests__/RichInputElement.test.js on lines 288..294
    app/javascript/components/__tests__/RichInputElement.test.js on lines 314..320

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

    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 4 locations. Consider refactoring.
    Open

          expect(setChosenUsersMock).toHaveBeenCalledWith(
              [{id: 1, first_name: 'George', last_name: 'Washington'},
                {id: 2, first_name: 'Jackie', last_name: 'Chan'},
                {id: 3, first_name: 'Janice', last_name: 'Wednesday'},
                {id: 5, first_name: 'Kieran', last_name: 'Roomie'},
    app/javascript/components/__tests__/RichInputElement.test.js on lines 288..294
    app/javascript/components/__tests__/RichInputElement.test.js on lines 314..320
    app/javascript/components/__tests__/RichInputElement.test.js on lines 344..350

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

    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 richText = 'Hey ' + highlightAT + RichText.userFullName(listUsers[0]) + '</span>, ' +
              highlightAT + RichText.userFullName(listUsers[1]) + '</span> and ' +
              highlightAT + RichText.userFullName(listUsers[2]) + '</span> , thanks for non-stop renew))'
    Severity: Major
    Found in app/javascript/components/__tests__/RichInputElement.test.js and 1 other location - About 2 hrs to fix
    app/javascript/components/__tests__/RichInputElement.test.js on lines 85..87

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

    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 richText = 'Hey ' + highlightAT + RichText.userFullName(listUsers[0]) + '</span> , ' +
              highlightAT + RichText.userFullName(listUsers[1]) + '</span> and ' +
              highlightAT + RichText.userFullName(listUsers[2]) + '</span> , thanks for non-stop renew))'
    Severity: Major
    Found in app/javascript/components/__tests__/RichInputElement.test.js and 1 other location - About 2 hrs to fix
    app/javascript/components/__tests__/RichInputElement.test.js on lines 137..139

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

    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 4 locations. Consider refactoring.
    Open

          expect(setChosenUsersMock).toHaveBeenCalledWith([{id: 1, first_name: 'George', last_name: 'Washington'},
            {id: 2, first_name: 'Jackie', last_name: 'Chan'}, {id: 3, first_name: 'Janice', last_name: 'Wednesday'}])
    app/javascript/components/__tests__/RichInputElement.test.js on lines 144..145
    app/javascript/components/__tests__/RichInputElement.test.js on lines 156..157
    app/javascript/components/__tests__/RichInputElement.test.js on lines 214..215

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

    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 4 locations. Consider refactoring.
    Open

          expect(setChosenUsersMock).toHaveBeenCalledWith([{id: 1, first_name: 'George', last_name: 'Washington'},
            {id: 2, first_name: 'Jackie', last_name: 'Chan'}, {id: 3, first_name: 'Janice', last_name: 'Wednesday'}])
    app/javascript/components/__tests__/RichInputElement.test.js on lines 91..92
    app/javascript/components/__tests__/RichInputElement.test.js on lines 156..157
    app/javascript/components/__tests__/RichInputElement.test.js on lines 214..215

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

    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 4 locations. Consider refactoring.
    Open

          expect(setChosenUsersMock).toHaveBeenCalledWith([{id: 3, first_name: 'Janice', last_name: 'Wednesday'},
            {id: 2, first_name: 'Jackie', last_name: 'Chan'}, {id: 1, first_name: 'George', last_name: 'Washington'}])
    app/javascript/components/__tests__/RichInputElement.test.js on lines 91..92
    app/javascript/components/__tests__/RichInputElement.test.js on lines 144..145
    app/javascript/components/__tests__/RichInputElement.test.js on lines 156..157

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

    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 4 locations. Consider refactoring.
    Open

          expect(setChosenUsersMock).toHaveBeenCalledWith([{id: 2, first_name: 'Jackie', last_name: 'Chan'},
            {id: 3, first_name: 'Janice', last_name: 'Wednesday'}, {id: 6, first_name: 'Mike', last_name: 'Snider'}])
    app/javascript/components/__tests__/RichInputElement.test.js on lines 91..92
    app/javascript/components/__tests__/RichInputElement.test.js on lines 144..145
    app/javascript/components/__tests__/RichInputElement.test.js on lines 214..215

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

    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 richText = 'Hey ' + highlightAT + RichText.userFullName(listUsers[0]) + '</span> and ' +
              highlightAT + RichText.userFullName(listUsers[1]) + '</span>, thanks for non-stop renew))'
    app/javascript/components/__tests__/RichInputElement.test.js on lines 198..199

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

    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 richText = 'Hey ' + highlightAT + RichText.userFullName(listUsers[2]) + '</span>, ' +
              highlightAT + RichText.userFullName(listUsers[1]) + '</span> and '
    app/javascript/components/__tests__/RichInputElement.test.js on lines 119..120

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

    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

          expect(setChosenUsersMock).toHaveBeenCalledWith([{id: 2, first_name: 'Jackie', last_name: 'Chan'},
            {id: 3, first_name: 'Janice', last_name: 'Wednesday'}]);
    Severity: Major
    Found in app/javascript/components/__tests__/RichInputElement.test.js and 4 other locations - About 45 mins to fix
    app/javascript/components/__tests__/RichInputElement.test.js on lines 100..101
    app/javascript/components/__tests__/RichInputElement.test.js on lines 124..125
    app/javascript/components/__tests__/RichInputElement.test.js on lines 193..194
    app/javascript/components/__tests__/RichInputElement.test.js on lines 204..205

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

    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

          expect(setChosenUsersMock).toHaveBeenCalledWith([{id: 1, first_name: 'George', last_name: 'Washington'},
            {id: 9, first_name: 'roger', last_name: ''}])
    Severity: Major
    Found in app/javascript/components/__tests__/RichInputElement.test.js and 4 other locations - About 45 mins to fix
    app/javascript/components/__tests__/RichInputElement.test.js on lines 100..101
    app/javascript/components/__tests__/RichInputElement.test.js on lines 124..125
    app/javascript/components/__tests__/RichInputElement.test.js on lines 149..150
    app/javascript/components/__tests__/RichInputElement.test.js on lines 204..205

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

    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

          expect(setChosenUsersMock).toHaveBeenCalledWith([{id: 2, first_name: 'Jackie', last_name: 'Chan'},
            {id: 3, first_name: 'Janice', last_name: 'Wednesday'}])
    Severity: Major
    Found in app/javascript/components/__tests__/RichInputElement.test.js and 4 other locations - About 45 mins to fix
    app/javascript/components/__tests__/RichInputElement.test.js on lines 124..125
    app/javascript/components/__tests__/RichInputElement.test.js on lines 149..150
    app/javascript/components/__tests__/RichInputElement.test.js on lines 193..194
    app/javascript/components/__tests__/RichInputElement.test.js on lines 204..205

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

    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

          expect(setChosenUsersMock).toHaveBeenCalledWith([{id: 3, first_name: 'Janice', last_name: 'Wednesday'},
            {id: 2, first_name: 'Jackie', last_name: 'Chan'}])
    Severity: Major
    Found in app/javascript/components/__tests__/RichInputElement.test.js and 4 other locations - About 45 mins to fix
    app/javascript/components/__tests__/RichInputElement.test.js on lines 100..101
    app/javascript/components/__tests__/RichInputElement.test.js on lines 124..125
    app/javascript/components/__tests__/RichInputElement.test.js on lines 149..150
    app/javascript/components/__tests__/RichInputElement.test.js on lines 193..194

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

    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

          expect(setChosenUsersMock).toHaveBeenCalledWith([{id: 1, first_name: 'George', last_name: 'Washington'},
            {id: 2, first_name: 'Jackie', last_name: 'Chan'}])
    Severity: Major
    Found in app/javascript/components/__tests__/RichInputElement.test.js and 4 other locations - About 45 mins to fix
    app/javascript/components/__tests__/RichInputElement.test.js on lines 100..101
    app/javascript/components/__tests__/RichInputElement.test.js on lines 149..150
    app/javascript/components/__tests__/RichInputElement.test.js on lines 193..194
    app/javascript/components/__tests__/RichInputElement.test.js on lines 204..205

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

    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

          listItems.forEach((listItem, index) => {
            expect(listItem.textContent).toBe(RichText.userFullName(listUsers[index]));
          });
    Severity: Major
    Found in app/javascript/components/__tests__/RichInputElement.test.js and 2 other locations - About 40 mins to fix
    app/javascript/components/__tests__/RichInputElement.test.js on lines 113..115
    app/javascript/components/__tests__/RichInputElement.test.js on lines 536..538

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

    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

          listItems.forEach((listItem, index) => {
            expect(listItem.textContent).toContain(RichText.userFullName(filteredUsers[index]));
          });
    Severity: Major
    Found in app/javascript/components/__tests__/RichInputElement.test.js and 2 other locations - About 40 mins to fix
    app/javascript/components/__tests__/RichInputElement.test.js on lines 113..115
    app/javascript/components/__tests__/RichInputElement.test.js on lines 227..229

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

    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

          listItems.forEach((listItem, index) => {
            expect(listItem.textContent).toBe(RichText.userFullName(expectedUsers[index]));
          });
    Severity: Major
    Found in app/javascript/components/__tests__/RichInputElement.test.js and 2 other locations - About 40 mins to fix
    app/javascript/components/__tests__/RichInputElement.test.js on lines 227..229
    app/javascript/components/__tests__/RichInputElement.test.js on lines 536..538

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

    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

    There are no issues that match your filters.

    Category
    Status