intraxia/wp-gistpen

View on GitHub
client/block/EditEmbed/index.tsx

Summary

Maintainability
F
6 days
Test Coverage

File index.tsx has 483 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { useEffect, useMemo } from 'react';
import Prism from 'prismjs';
import {
  useDelta,
  EddyReducer,
Severity: Minor
Found in client/block/EditEmbed/index.tsx - About 7 hrs to fix

    Function embedReducer has 114 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const embedReducer: EddyReducer<EmbedState, RootAction> = (
      state = defaultEmbedState,
      action: RootAction,
    ) => {
      switch (action.type) {
    Severity: Major
    Found in client/block/EditEmbed/index.tsx - About 4 hrs to fix

      Function rootDelta has 90 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const rootDelta: Delta<RootAction, State> = (action$, state$) => {
        const fetch$ = state$
          .thru(sampleByAction(action$, fetchBlob.request))
          .flatMap(state =>
            ajax$(
      Severity: Major
      Found in client/block/EditEmbed/index.tsx - About 3 hrs to fix

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

          const saveMe$ = state$
            .thru(sampleByAction(action$, saveMe.request))
            .zip(
              action$.thru(ofType(saveMe.request)),
              (state, action) => [state, action] as const,
        Severity: Major
        Found in client/block/EditEmbed/index.tsx and 1 other location - About 6 hrs to fix
        client/block/EditEmbed/index.tsx on lines 265..282

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

        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 saveSettings$ = state$
            .thru(sampleByAction(action$, saveSettings.request))
            .zip(
              action$.thru(ofType(saveSettings.request)),
              (state, action) => [state, action] as const,
        Severity: Major
        Found in client/block/EditEmbed/index.tsx and 1 other location - About 6 hrs to fix
        client/block/EditEmbed/index.tsx on lines 295..310

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

        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 fetchMe$ = state$
            .thru(sampleByAction(action$, fetchMe.request))
            .flatMap(state =>
              ajax$(`${state.globals.root}me`, {
                headers: {
        Severity: Major
        Found in client/block/EditEmbed/index.tsx and 1 other location - About 3 hrs to fix
        client/block/EditEmbed/index.tsx on lines 252..263

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

        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 fetchSettings$ = state$
            .thru(sampleByAction(action$, fetchSettings.request))
            .flatMap(state =>
              ajax$(`${state.globals.root}site`, {
                headers: {
        Severity: Major
        Found in client/block/EditEmbed/index.tsx and 1 other location - About 3 hrs to fix
        client/block/EditEmbed/index.tsx on lines 284..293

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

        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 preplugWidth = (e$: Observable<RootAction, never>) =>
          e$
            .thru(ofType(wpActions.change))
            .map(a => editWidthChange(Number(a.payload.value)));
        Severity: Major
        Found in client/block/EditEmbed/index.tsx and 1 other location - About 1 hr to fix
        client/block/EditEmbed/index.tsx on lines 360..363

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

        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 preplugOffset = (e$: Observable<RootAction, never>) =>
          e$
            .thru(ofType(wpActions.change))
            .map(a => offsetChange(Number(a.payload.value)));
        Severity: Major
        Found in client/block/EditEmbed/index.tsx and 1 other location - About 1 hr to fix
        client/block/EditEmbed/index.tsx on lines 340..343

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

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

        const preplugFilename = (e$: Observable<RootAction, never>) =>
          e$
            .thru(ofType(wpActions.change))
            .map(a => editFilenameChange(a.payload.value));
        Severity: Major
        Found in client/block/EditEmbed/index.tsx and 6 other locations - About 1 hr to fix
        client/block/EditEmbed/index.tsx on lines 328..331
        client/block/EditEmbed/index.tsx on lines 338..339
        client/block/EditEmbed/index.tsx on lines 344..347
        client/block/EditEmbed/index.tsx on lines 348..351
        client/block/EditEmbed/index.tsx on lines 352..355
        client/block/EditEmbed/index.tsx on lines 357..358

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

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

        const preplugLanguages = (e$: Observable<RootAction, never>) =>
          e$
            .thru(ofType(wpActions.change))
            .map(a => editLanguageChange(a.payload.value));
        Severity: Major
        Found in client/block/EditEmbed/index.tsx and 6 other locations - About 1 hr to fix
        client/block/EditEmbed/index.tsx on lines 324..327
        client/block/EditEmbed/index.tsx on lines 338..339
        client/block/EditEmbed/index.tsx on lines 344..347
        client/block/EditEmbed/index.tsx on lines 348..351
        client/block/EditEmbed/index.tsx on lines 352..355
        client/block/EditEmbed/index.tsx on lines 357..358

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

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

        const preplugTabs = (e$: Observable<RootAction, never>) =>
          e$
            .thru(ofType(wpActions.checked))
            .map(a => editTabsChange(a.payload.isChecked));
        Severity: Major
        Found in client/block/EditEmbed/index.tsx and 6 other locations - About 1 hr to fix
        client/block/EditEmbed/index.tsx on lines 324..327
        client/block/EditEmbed/index.tsx on lines 328..331
        client/block/EditEmbed/index.tsx on lines 338..339
        client/block/EditEmbed/index.tsx on lines 348..351
        client/block/EditEmbed/index.tsx on lines 352..355
        client/block/EditEmbed/index.tsx on lines 357..358

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

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

        const preplugHighlight = (e$: Observable<RootAction, never>) =>
          e$.thru(ofType(wpActions.change)).map(a => highlightChange(a.payload.value));
        Severity: Major
        Found in client/block/EditEmbed/index.tsx and 6 other locations - About 1 hr to fix
        client/block/EditEmbed/index.tsx on lines 324..327
        client/block/EditEmbed/index.tsx on lines 328..331
        client/block/EditEmbed/index.tsx on lines 338..339
        client/block/EditEmbed/index.tsx on lines 344..347
        client/block/EditEmbed/index.tsx on lines 348..351
        client/block/EditEmbed/index.tsx on lines 352..355

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

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

        const preplugLineNumbers = (e$: Observable<RootAction, never>) =>
          e$
            .thru(ofType(wpActions.checked))
            .map(a => editLineNumbersChange(a.payload.isChecked));
        Severity: Major
        Found in client/block/EditEmbed/index.tsx and 6 other locations - About 1 hr to fix
        client/block/EditEmbed/index.tsx on lines 324..327
        client/block/EditEmbed/index.tsx on lines 328..331
        client/block/EditEmbed/index.tsx on lines 338..339
        client/block/EditEmbed/index.tsx on lines 344..347
        client/block/EditEmbed/index.tsx on lines 348..351
        client/block/EditEmbed/index.tsx on lines 357..358

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

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

        const preplugTheme = (e$: Observable<RootAction, never>) =>
          e$.thru(ofType(wpActions.change)).map(a => editThemeChange(a.payload.value));
        Severity: Major
        Found in client/block/EditEmbed/index.tsx and 6 other locations - About 1 hr to fix
        client/block/EditEmbed/index.tsx on lines 324..327
        client/block/EditEmbed/index.tsx on lines 328..331
        client/block/EditEmbed/index.tsx on lines 344..347
        client/block/EditEmbed/index.tsx on lines 348..351
        client/block/EditEmbed/index.tsx on lines 352..355
        client/block/EditEmbed/index.tsx on lines 357..358

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

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

        const preplugShowInvisibles = (e$: Observable<RootAction, never>) =>
          e$
            .thru(ofType(wpActions.checked))
            .map(a => editShowInvisiblesChange(a.payload.isChecked));
        Severity: Major
        Found in client/block/EditEmbed/index.tsx and 6 other locations - About 1 hr to fix
        client/block/EditEmbed/index.tsx on lines 324..327
        client/block/EditEmbed/index.tsx on lines 328..331
        client/block/EditEmbed/index.tsx on lines 338..339
        client/block/EditEmbed/index.tsx on lines 344..347
        client/block/EditEmbed/index.tsx on lines 352..355
        client/block/EditEmbed/index.tsx on lines 357..358

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

        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

        const preplugSaveSite = (e$: Observable<RootAction, never>) =>
          e$.thru(ofType(wpActions.click)).map(() => saveSiteClick());
        Severity: Major
        Found in client/block/EditEmbed/index.tsx and 2 other locations - About 55 mins to fix
        client/block/EditEmbed/index.tsx on lines 332..333
        client/block/EditEmbed/index.tsx on lines 334..335

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

        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

        const preplugSaveSnippet = (e$: Observable<RootAction, never>) =>
          e$.thru(ofType(wpActions.click)).map(() => saveSnippetClick());
        Severity: Major
        Found in client/block/EditEmbed/index.tsx and 2 other locations - About 55 mins to fix
        client/block/EditEmbed/index.tsx on lines 334..335
        client/block/EditEmbed/index.tsx on lines 336..337

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

        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

        const preplugSaveEditor = (e$: Observable<RootAction, never>) =>
          e$.thru(ofType(wpActions.click)).map(() => saveEditorClick());
        Severity: Major
        Found in client/block/EditEmbed/index.tsx and 2 other locations - About 55 mins to fix
        client/block/EditEmbed/index.tsx on lines 332..333
        client/block/EditEmbed/index.tsx on lines 336..337

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

        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