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

export const pathAndPartOfListItemWithIdInHeaders = (headers, listItemId) =>
  headers
    .map((header, headerIndex) => {
      const pathAndPart = pathAndPartOfListItemWithIdInAttributedString(
        header.get('description'),
Severity: Major
Found in src/lib/org_utils.js and 1 other location - About 4 hrs to fix
src/lib/org_utils.js on lines 605..623

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

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 pathAndPartOfTableContainingCellIdInHeaders = (headers, cellId) =>
  headers
    .map((header, headerIndex) => {
      const pathAndPart = pathAndPartOfTableContainingCellIdInAttributedString(
        header.get('description'),
Severity: Major
Found in src/lib/org_utils.js and 1 other location - About 4 hrs to fix
src/lib/org_utils.js on lines 585..603

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

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

    it('should insert at the top of file', () => {
      const newHeaders = insertCapture(path, templateTopLevel, true);
      expectOrigLastHeader(newHeaders);
      const first = newHeaders.first();
      expect(first.getIn(['titleLine', 'rawTitle'])).toEqual('My task');
Severity: Major
Found in src/reducers/org.unit.test.js and 1 other location - About 4 hrs to fix
src/reducers/org.unit.test.js on lines 245..252

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

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

    it('should insert at the bottom of file', () => {
      const newHeaders = insertCapture(path, templateTopLevel, false);
      expectOrigFirstHeader(newHeaders);
      const last = newHeaders.last();
      expect(last.getIn(['titleLine', 'rawTitle'])).toEqual('My task');
Severity: Major
Found in src/reducers/org.unit.test.js and 1 other location - About 4 hrs to fix
src/reducers/org.unit.test.js on lines 236..243

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

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

    it('should clear the compound when children are undone', () => {
      const oldState = state.org.present;
      const newState = reducer(oldState, types.advanceCheckboxState(bottomDeepNestedBoxN));
      expect(
        headerWithId(newState.getIn(['files', path, 'headers']), bottomHeaderId)
Severity: Major
Found in src/reducers/org.unit.test.js and 1 other location - About 4 hrs to fix
src/reducers/org.unit.test.js on lines 1600..1609

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

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

    it('should keep the partial state when some children are not checked', () => {
      const oldState = state.org.present;
      const newState = reducer(oldState, types.advanceCheckboxState(bottomNestedBoxK));
      expect(
        headerWithId(newState.getIn(['files', path, 'headers']), bottomHeaderId)
Severity: Major
Found in src/reducers/org.unit.test.js and 1 other location - About 4 hrs to fix
src/reducers/org.unit.test.js on lines 1611..1620

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

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

      it('should reset header narrowing', () => {
        const narrowedState = reducer(state.org.present, types.narrowHeader(nestedHeaderId));
        expect(narrowedState.getIn(['files', path, 'narrowedHeaderId'])).toEqual(nestedHeaderId);
        const newState = reducer(narrowedState, types.removeHeader(nestedHeaderId));
        expect(newState.getIn(['files', path, 'narrowedHeaderId'])).toEqual(null);
Severity: Major
Found in src/reducers/org.unit.test.js and 1 other location - About 4 hrs to fix
src/reducers/org.unit.test.js on lines 566..571

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

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 updateListTitleValue = (state, action) => {
  const selectedListItemId = action.listItemId;
  if (!selectedListItemId) {
    return state;
  }
Severity: Major
Found in src/reducers/org.js and 1 other location - About 4 hrs to fix
src/reducers/org.js on lines 1023..1038

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

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 updateListContentsValue = (state, action) => {
  const selectedListItemId = action.listItemId;
  if (!selectedListItemId) {
    return state;
  }
Severity: Major
Found in src/reducers/org.js and 1 other location - About 4 hrs to fix
src/reducers/org.js on lines 1006..1021

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

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

      it('should reset header narrowing', () => {
        const narrowedState = reducer(state.org.present, types.narrowHeader(nestedHeaderId));
        expect(narrowedState.getIn(['files', path, 'narrowedHeaderId'])).toEqual(nestedHeaderId);
        const newState = reducer(narrowedState, types.removeHeader(nestedHeaderId));
        expect(newState.getIn(['files', path, 'narrowedHeaderId'])).toEqual(null);
Severity: Major
Found in src/reducers/org.unit.test.js and 1 other location - About 4 hrs to fix
src/reducers/org.unit.test.js on lines 529..534

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

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

        it("should select junior header when it's above", () => {
          const stateSelected = selectHeader(
            openHeaders(state.org.present, openAll),
            nestedHeader2Id
          );
Severity: Major
Found in src/reducers/org.unit.test.js and 7 other locations - About 3 hrs to fix
src/reducers/org.unit.test.js on lines 591..599
src/reducers/org.unit.test.js on lines 611..621
src/reducers/org.unit.test.js on lines 623..633
src/reducers/org.unit.test.js on lines 643..651
src/reducers/org.unit.test.js on lines 653..661
src/reducers/org.unit.test.js on lines 663..673
src/reducers/org.unit.test.js on lines 675..683

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

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

        it('do nothing on the last header', () => {
          const stateSelected = selectHeader(
            openHeaders(state.org.present, openAll),
            nestedHeader2Id
          );
Severity: Major
Found in src/reducers/org.unit.test.js and 7 other locations - About 3 hrs to fix
src/reducers/org.unit.test.js on lines 591..599
src/reducers/org.unit.test.js on lines 601..609
src/reducers/org.unit.test.js on lines 611..621
src/reducers/org.unit.test.js on lines 623..633
src/reducers/org.unit.test.js on lines 643..651
src/reducers/org.unit.test.js on lines 653..661
src/reducers/org.unit.test.js on lines 663..673

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

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

        it('should skip invisible header', () => {
          const stateSelected = selectHeader(
            openHeaders(state.org.present, openOnlyTop),
            nestedHeaderId
          );
Severity: Major
Found in src/reducers/org.unit.test.js and 7 other locations - About 3 hrs to fix
src/reducers/org.unit.test.js on lines 591..599
src/reducers/org.unit.test.js on lines 601..609
src/reducers/org.unit.test.js on lines 611..621
src/reducers/org.unit.test.js on lines 623..633
src/reducers/org.unit.test.js on lines 653..661
src/reducers/org.unit.test.js on lines 663..673
src/reducers/org.unit.test.js on lines 675..683

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

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

        it('should select child when its visible', () => {
          const stateSelected = selectHeader(
            openHeaders(state.org.present, openAll),
            nestedHeaderId
          );
Severity: Major
Found in src/reducers/org.unit.test.js and 7 other locations - About 3 hrs to fix
src/reducers/org.unit.test.js on lines 591..599
src/reducers/org.unit.test.js on lines 601..609
src/reducers/org.unit.test.js on lines 611..621
src/reducers/org.unit.test.js on lines 623..633
src/reducers/org.unit.test.js on lines 643..651
src/reducers/org.unit.test.js on lines 663..673
src/reducers/org.unit.test.js on lines 675..683

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

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

        it('do nothing on the first header', () => {
          const stateSelected = selectHeader(
            openHeaders(state.org.present, openAll),
            topLevelHeaderId
          );
Severity: Major
Found in src/reducers/org.unit.test.js and 7 other locations - About 3 hrs to fix
src/reducers/org.unit.test.js on lines 591..599
src/reducers/org.unit.test.js on lines 601..609
src/reducers/org.unit.test.js on lines 611..621
src/reducers/org.unit.test.js on lines 643..651
src/reducers/org.unit.test.js on lines 653..661
src/reducers/org.unit.test.js on lines 663..673
src/reducers/org.unit.test.js on lines 675..683

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

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

        it('should skip invisible header', () => {
          const stateSelected = selectHeader(
            openHeaders(state.org.present, openOnlyTop),
            nestedHeader2Id
          );
Severity: Major
Found in src/reducers/org.unit.test.js and 7 other locations - About 3 hrs to fix
src/reducers/org.unit.test.js on lines 601..609
src/reducers/org.unit.test.js on lines 611..621
src/reducers/org.unit.test.js on lines 623..633
src/reducers/org.unit.test.js on lines 643..651
src/reducers/org.unit.test.js on lines 653..661
src/reducers/org.unit.test.js on lines 663..673
src/reducers/org.unit.test.js on lines 675..683

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

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

        it("should select elder header when it's below", () => {
          const stateSelected = selectHeader(
            openHeaders(state.org.present, openAll),
            deepNestedHeaderId
          );
Severity: Major
Found in src/reducers/org.unit.test.js and 7 other locations - About 3 hrs to fix
src/reducers/org.unit.test.js on lines 591..599
src/reducers/org.unit.test.js on lines 601..609
src/reducers/org.unit.test.js on lines 611..621
src/reducers/org.unit.test.js on lines 623..633
src/reducers/org.unit.test.js on lines 643..651
src/reducers/org.unit.test.js on lines 653..661
src/reducers/org.unit.test.js on lines 675..683

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

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

        it('should select parent header', () => {
          const stateSelected = selectHeader(
            openHeaders(state.org.present, openAll),
            deepNestedHeaderId
          );
Severity: Major
Found in src/reducers/org.unit.test.js and 7 other locations - About 3 hrs to fix
src/reducers/org.unit.test.js on lines 591..599
src/reducers/org.unit.test.js on lines 601..609
src/reducers/org.unit.test.js on lines 623..633
src/reducers/org.unit.test.js on lines 643..651
src/reducers/org.unit.test.js on lines 653..661
src/reducers/org.unit.test.js on lines 663..673
src/reducers/org.unit.test.js on lines 675..683

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

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

    beforeEach(() => {
      state = setUpStateForFile(path, testOrgFile);
      headerId = state.org.present.getIn(['files', path, 'headers']).get(0).get('id');
      irrelevantHeaderId = state.org.present.getIn(['files', path, 'headers']).get(1).get('id');
    });
Severity: Major
Found in src/reducers/org.unit.test.js and 2 other locations - About 3 hrs to fix
src/reducers/org.unit.test.js on lines 1091..1095
src/reducers/org.unit.test.js on lines 1315..1319

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

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

    beforeEach(() => {
      state = setUpStateForFile(path, testOrgFile);
      headerId = state.org.present.getIn(['files', path, 'headers']).get(1).get('id');
      irrelevantHeaderId = state.org.present.getIn(['files', path, 'headers']).get(0).get('id');
    });
Severity: Major
Found in src/reducers/org.unit.test.js and 2 other locations - About 3 hrs to fix
src/reducers/org.unit.test.js on lines 1010..1014
src/reducers/org.unit.test.js on lines 1315..1319

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

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