200ok-ch/organice

View on GitHub

Showing 1,494 of 1,494 total issues

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

    const extraSiblingHeadline = {
      planningItems: [],
      logBookEntries: [],
      opened: false,
      titleLine: {
Severity: Major
Found in src/lib/org_utils.unit.test.js and 1 other location - About 2 hrs to fix
src/lib/org_utils.unit.test.js on lines 115..134

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

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

    test('Log notes of first headline are parsed', () => {
      expect(parsed.headers[0].logNotes[0].type).toEqual('list');
      expect(parsed.headers[0].logNotes[0].items.length).toEqual(1);
    });
Severity: Major
Found in src/components/OrgFile/OrgFile.unit.test.js and 1 other location - About 2 hrs to fix
src/components/OrgFile/OrgFile.unit.test.js on lines 441..444

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

export const subtractTimestampUnitFromDate = (date, numUnits, timestampUnit) => {
  switch (timestampUnit) {
    case 'h':
      return subHours(date, numUnits);
    case 'd':
Severity: Major
Found in src/lib/timestamps.js and 1 other location - About 2 hrs to fix
src/lib/timestamps.js on lines 114..129

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

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

    test('Log notes of second headline are parsed', () => {
      expect(parsed.headers[1].logNotes[0].type).toEqual('list');
      expect(parsed.headers[1].logNotes[0].items.length).toEqual(4);
    });
Severity: Major
Found in src/components/OrgFile/OrgFile.unit.test.js and 1 other location - About 2 hrs to fix
src/components/OrgFile/OrgFile.unit.test.js on lines 437..440

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

export const addTimestampUnitToDate = (date, numUnits, timestampUnit) => {
  switch (timestampUnit) {
    case 'h':
      return addHours(date, numUnits);
    case 'd':
Severity: Major
Found in src/lib/timestamps.js and 1 other location - About 2 hrs to fix
src/lib/timestamps.js on lines 131..146

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

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

      expectField('date:2019-11-30..2020').toEqual({
        type: 'date',
        timerange: {
          type: 'range',
          from: {
Severity: Major
Found in src/lib/headline_filter_parser.unit.test.js and 1 other location - About 2 hrs to fix
src/lib/headline_filter_parser.unit.test.js on lines 484..501

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

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

      expectField('date:2019-01-30..2020').toEqual({
        type: 'date',
        timerange: {
          type: 'range',
          from: {
Severity: Major
Found in src/lib/headline_filter_parser.unit.test.js and 1 other location - About 2 hrs to fix
src/lib/headline_filter_parser.unit.test.js on lines 394..411

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

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

Function timeFilter has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

export const timeFilter = (filterDescription) => {
  const timeFilterDescription = filterDescription.field.timerange;
  let lower;
  let upper;
  if (timeFilterDescription.type === 'point') {
Severity: Minor
Found in src/lib/headline_filter.js - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function parseMarkupAndCookies has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

export const parseMarkupAndCookies = (rawText, { shouldAppendNewline = false } = {}) => {
  const matches = [];
  let match = markupAndCookieRegex.exec(rawText);
  while (match) {
    if (!!match[2]) {
Severity: Minor
Found in src/lib/parse_org.js - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function constructor has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

  constructor(props) {
    super(props);

    runAllMigrations();

Severity: Minor
Found in src/App.js - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

  handleListTitleChange(event) {
    const { listTitleValues } = this.state;
    const {
      subPartDataAndHandlers: { selectedListItemId },
    } = this.props;
src/components/OrgFile/components/AttributedString/components/ListPart/index.js on lines 144..153

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

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

  handleListContentsChange(event) {
    const { listContentsValues } = this.state;
    const {
      subPartDataAndHandlers: { selectedListItemId },
    } = this.props;
src/components/OrgFile/components/AttributedString/components/ListPart/index.js on lines 133..142

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

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

            if (pathAndPart) {
              const { path, timestampPart } = pathAndPart;
              return {
                path: [partIndex, 'items', itemIndex, 'contents'].concat(path),
                timestampPart,
Severity: Major
Found in src/lib/org_utils.js and 1 other location - About 2 hrs to fix
src/lib/org_utils.js on lines 408..427

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

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

            if (item.get('id') === listItemId) {
              return {
                path: [partIndex, 'items', itemIndex],
                listItemPart: item,
              };
Severity: Major
Found in src/lib/org_utils.js and 1 other location - About 2 hrs to fix
src/lib/org_utils.js on lines 328..348

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

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

          test('relative link to subdir', () => {
            const elem = getAllByText('subdir');
            expect(elem.length).toEqual(1);
            expect(elem[0]).toHaveAttribute('href', '/files/dir1/dir2/subdir');
            expect(elem[0]).toHaveTextContent('subdir');
Severity: Major
Found in src/components/OrgFile/OrgFile.integration.test.js and 8 other locations - About 2 hrs to fix
src/components/OrgFile/OrgFile.integration.test.js on lines 653..658
src/components/OrgFile/OrgFile.integration.test.js on lines 660..665
src/components/OrgFile/OrgFile.integration.test.js on lines 667..672
src/components/OrgFile/OrgFile.integration.test.js on lines 674..679
src/components/OrgFile/OrgFile.integration.test.js on lines 681..686
src/components/OrgFile/OrgFile.integration.test.js on lines 688..693
src/components/OrgFile/OrgFile.integration.test.js on lines 695..705
src/components/OrgFile/OrgFile.integration.test.js on lines 732..737

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

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

          test('absolute link to fictitious .org file', () => {
            const elem = getAllByText('a fictitious .org file');
            expect(elem.length).toEqual(1);
            expect(elem[0]).toHaveAttribute('data-target', '/foo/bar/baz.org');
            expect(elem[0]).toHaveTextContent('a fictitious .org file');
Severity: Major
Found in src/components/OrgFile/OrgFile.integration.test.js and 8 other locations - About 2 hrs to fix
src/components/OrgFile/OrgFile.integration.test.js on lines 646..651
src/components/OrgFile/OrgFile.integration.test.js on lines 653..658
src/components/OrgFile/OrgFile.integration.test.js on lines 660..665
src/components/OrgFile/OrgFile.integration.test.js on lines 667..672
src/components/OrgFile/OrgFile.integration.test.js on lines 674..679
src/components/OrgFile/OrgFile.integration.test.js on lines 681..686
src/components/OrgFile/OrgFile.integration.test.js on lines 688..693
src/components/OrgFile/OrgFile.integration.test.js on lines 695..705

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

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

          test('relative link to fictitious .org file in a parent directory', () => {
            const elem = getAllByText('a fictitious .org file in a parent directory');
            expect(elem.length).toEqual(1);
            expect(elem[0]).toHaveAttribute('data-target', '/dir1/foo.org_archive');
            expect(elem[0]).toHaveTextContent('a fictitious .org file in a parent directory');
Severity: Major
Found in src/components/OrgFile/OrgFile.integration.test.js and 8 other locations - About 2 hrs to fix
src/components/OrgFile/OrgFile.integration.test.js on lines 646..651
src/components/OrgFile/OrgFile.integration.test.js on lines 653..658
src/components/OrgFile/OrgFile.integration.test.js on lines 660..665
src/components/OrgFile/OrgFile.integration.test.js on lines 674..679
src/components/OrgFile/OrgFile.integration.test.js on lines 681..686
src/components/OrgFile/OrgFile.integration.test.js on lines 688..693
src/components/OrgFile/OrgFile.integration.test.js on lines 695..705
src/components/OrgFile/OrgFile.integration.test.js on lines 732..737

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

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

          test('relative link to fictitious .org file in a grand-parent directory', () => {
            const elem = getAllByText('a fictitious .org file in a grand-parent directory');
            expect(elem.length).toEqual(1);
            expect(elem[0]).toHaveAttribute('data-target', '/foo.org');
            expect(elem[0]).toHaveTextContent('a fictitious .org file in a grand-parent directory');
Severity: Major
Found in src/components/OrgFile/OrgFile.integration.test.js and 8 other locations - About 2 hrs to fix
src/components/OrgFile/OrgFile.integration.test.js on lines 646..651
src/components/OrgFile/OrgFile.integration.test.js on lines 653..658
src/components/OrgFile/OrgFile.integration.test.js on lines 660..665
src/components/OrgFile/OrgFile.integration.test.js on lines 667..672
src/components/OrgFile/OrgFile.integration.test.js on lines 674..679
src/components/OrgFile/OrgFile.integration.test.js on lines 681..686
src/components/OrgFile/OrgFile.integration.test.js on lines 695..705
src/components/OrgFile/OrgFile.integration.test.js on lines 732..737

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

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

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

  generateCellValueMap(table) {
    return Map(
      table
        .get('contents')
        .map((row) => row.get('contents').map((cell) => [cell.get('id'), cell.get('rawContents')]))
src/components/OrgFile/components/TableEditorModal/index.js on lines 70..77

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

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

          test('relative link to ../subdir', () => {
            const elem = getAllByText('../subdir');
            expect(elem.length).toEqual(1);
            expect(elem[0]).toHaveAttribute('href', '/files/dir1/subdir');
            expect(elem[0]).toHaveTextContent('../subdir');
Severity: Major
Found in src/components/OrgFile/OrgFile.integration.test.js and 8 other locations - About 2 hrs to fix
src/components/OrgFile/OrgFile.integration.test.js on lines 646..651
src/components/OrgFile/OrgFile.integration.test.js on lines 653..658
src/components/OrgFile/OrgFile.integration.test.js on lines 660..665
src/components/OrgFile/OrgFile.integration.test.js on lines 667..672
src/components/OrgFile/OrgFile.integration.test.js on lines 681..686
src/components/OrgFile/OrgFile.integration.test.js on lines 688..693
src/components/OrgFile/OrgFile.integration.test.js on lines 695..705
src/components/OrgFile/OrgFile.integration.test.js on lines 732..737

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

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