bookbrainz/bookbrainz-site

View on GitHub

Showing 1,033 of 1,033 total issues

Function handleRemoveEntities has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    handleRemoveEntities() {
        if (this.state.selectedEntities.length) {
            const bbids = this.state.selectedEntities;
            const submissionUrl = `/collection/${this.props.collection.id}/remove`;
            request.post(submissionUrl)
Severity: Minor
Found in src/client/components/pages/collection.js - About 1 hr to fix

    Function getOrderedRevisionsForEntityPage has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export async function getOrderedRevisionsForEntityPage(orm: any, from: number, size: number, RevisionModel, bbid: string) {
        const otherMergedBBIDs = await recursivelyGetMergedEntitiesBBIDs(orm, [bbid]);
    
        const revisions = await new RevisionModel()
            .query((qb) => {
    Severity: Minor
    Found in src/server/helpers/revisions.ts - About 1 hr to fix

      Function makeSortName has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function makeSortName(name: string): string {
          const articles = ['a', 'an', 'the', 'los', 'las', 'el', 'la'];
          const suffixes = [
              'i', 'ii', 'iii', 'iv', 'v', 'vi', 'vii', 'viii', 'ix', 'x', 'xi',
              'xii', 'xiii', 'xiv', 'xv', 'jr', 'junior', 'sr', 'senior', 'phd', 'md',
      Severity: Minor
      Found in src/client/entity-editor/common/sort-name-field.tsx - About 1 hr to fix

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

        function _setSeriesTitle(res) {
            res.locals.title = utils.createEntityPageTitle(
                res.locals.entity,
                'Series',
                utils.template`Series “${'name'}”`
        Severity: Major
        Found in src/server/routes/entity/series.ts and 5 other locations - About 1 hr to fix
        src/server/routes/entity/author.ts on lines 205..211
        src/server/routes/entity/edition-group.ts on lines 198..204
        src/server/routes/entity/edition.ts on lines 362..368
        src/server/routes/entity/publisher.ts on lines 190..196
        src/server/routes/entity/work.ts on lines 224..230

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

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

        function _setWorkTitle(res) {
            res.locals.title = utils.createEntityPageTitle(
                res.locals.entity,
                'Work',
                utils.template`Work “${'name'}”`
        Severity: Major
        Found in src/server/routes/entity/work.ts and 5 other locations - About 1 hr to fix
        src/server/routes/entity/author.ts on lines 205..211
        src/server/routes/entity/edition-group.ts on lines 198..204
        src/server/routes/entity/edition.ts on lines 362..368
        src/server/routes/entity/publisher.ts on lines 190..196
        src/server/routes/entity/series.ts on lines 199..205

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 59.

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

        function _setEditionTitle(res) {
            res.locals.title = utils.createEntityPageTitle(
                res.locals.entity,
                'Edition',
                utils.template`Edition “${'name'}”`
        Severity: Major
        Found in src/server/routes/entity/edition.ts and 5 other locations - About 1 hr to fix
        src/server/routes/entity/author.ts on lines 205..211
        src/server/routes/entity/edition-group.ts on lines 198..204
        src/server/routes/entity/publisher.ts on lines 190..196
        src/server/routes/entity/series.ts on lines 199..205
        src/server/routes/entity/work.ts on lines 224..230

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

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

        function _setEditionGroupTitle(res) {
            res.locals.title = utils.createEntityPageTitle(
                res.locals.entity,
                'EditionGroup',
                utils.template`Edition Group “${'name'}”`
        Severity: Major
        Found in src/server/routes/entity/edition-group.ts and 5 other locations - About 1 hr to fix
        src/server/routes/entity/author.ts on lines 205..211
        src/server/routes/entity/edition.ts on lines 362..368
        src/server/routes/entity/publisher.ts on lines 190..196
        src/server/routes/entity/series.ts on lines 199..205
        src/server/routes/entity/work.ts on lines 224..230

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

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

        function _setAuthorTitle(res) {
            res.locals.title = utils.createEntityPageTitle(
                res.locals.entity,
                'Author',
                utils.template`Author “${'name'}”`
        Severity: Major
        Found in src/server/routes/entity/author.ts and 5 other locations - About 1 hr to fix
        src/server/routes/entity/edition-group.ts on lines 198..204
        src/server/routes/entity/edition.ts on lines 362..368
        src/server/routes/entity/publisher.ts on lines 190..196
        src/server/routes/entity/series.ts on lines 199..205
        src/server/routes/entity/work.ts on lines 224..230

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

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

        function _setPublisherTitle(res) {
            res.locals.title = utils.createEntityPageTitle(
                res.locals.entity,
                'Publisher',
                utils.template`Publisher “${'name'}”`
        Severity: Major
        Found in src/server/routes/entity/publisher.ts and 5 other locations - About 1 hr to fix
        src/server/routes/entity/author.ts on lines 205..211
        src/server/routes/entity/edition-group.ts on lines 198..204
        src/server/routes/entity/edition.ts on lines 362..368
        src/server/routes/entity/series.ts on lines 199..205
        src/server/routes/entity/work.ts on lines 224..230

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

        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 function getEntityTable(entityType: string) {
            const tables = {
                Author: AuthorTable,
                Edition: EditionTable,
                EditionGroup: EditionGroupTable,
        Severity: Major
        Found in src/client/helpers/utils.tsx and 1 other location - About 1 hr to fix
        src/client/entity-editor/helpers.ts on lines 86..97

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

        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 function getEntitySectionMerge(entityType: string) {
            const SECTION_MAP = {
                author: AuthorSectionMerge,
                edition: EditionSectionMerge,
                editionGroup: EditionGroupSectionMerge,
        Severity: Major
        Found in src/client/entity-editor/helpers.ts and 1 other location - About 1 hr to fix
        src/client/helpers/utils.tsx on lines 231..241

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

        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 getOrderedRevisionForEditorPage has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export async function getOrderedRevisionForEditorPage(from, size, req) {
            const {Editor, Revision} = req.app.locals.orm;
        
            // If editor isn't present, throw an error
            await new Editor({id: req.params.id})
        Severity: Minor
        Found in src/server/helpers/revisions.ts - About 1 hr to fix

          Function addAuthorCreditRow has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function addAuthorCreditRow(state, newItemKey) {
              // Add a new empty author credit row
              let returnedState = state.set(newItemKey, EMPTY_CREDIT_ROW);
          
              const autoJoinPhraseRegex = /^(| & |, )$/;
          Severity: Minor
          Found in src/client/entity-editor/author-credit-editor/reducer.ts - About 1 hr to fix

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

                    const markup = ReactDOMServer.renderToString(
                        <Layout    {...propHelpers.extractLayoutProps(props)}>
                            <Index {...propHelpers.extractChildProps(props)}/>
                        </Layout>
                    );
            Severity: Major
            Found in src/server/routes/index.js and 2 other locations - About 1 hr to fix
            src/server/routes/collections.js on lines 69..73
            src/server/routes/revisions.js on lines 53..57

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

            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 markup = ReactDOMServer.renderToString(
                        <Layout {...propHelpers.extractLayoutProps(props)}>
                            <CollectionsPage {...propHelpers.extractChildProps(props)}/>
                        </Layout>
                    );
            Severity: Major
            Found in src/server/routes/collections.js and 2 other locations - About 1 hr to fix
            src/server/routes/index.js on lines 60..64
            src/server/routes/revisions.js on lines 53..57

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

            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 markup = ReactDOMServer.renderToString(
                        <Layout {...propHelpers.extractLayoutProps(props)}>
                            <RevisionsPage {...propHelpers.extractChildProps(props)}/>
                        </Layout>
                    );
            Severity: Major
            Found in src/server/routes/revisions.js and 2 other locations - About 1 hr to fix
            src/server/routes/collections.js on lines 69..73
            src/server/routes/index.js on lines 60..64

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

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

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

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

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

            Refactorings

            Further Reading

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

                const aliases = editionGroup.aliasSet ?
                    editionGroup.aliasSet.aliases.map(({languageId, ...rest}) => ({
                        ...rest,
                        language: languageId
                    })) : [];
            Severity: Major
            Found in src/server/routes/entity/edition-group.ts and 4 other locations - About 1 hr to fix
            src/server/routes/entity/author.ts on lines 252..256
            src/server/routes/entity/edition.ts on lines 411..415
            src/server/routes/entity/publisher.ts on lines 258..262
            src/server/routes/entity/work.ts on lines 270..274

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

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

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

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

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

            Refactorings

            Further Reading

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

                const aliases = edition.aliasSet ?
                    edition.aliasSet.aliases.map(({languageId, ...rest}) => ({
                        ...rest,
                        language: languageId
                    })) : [];
            Severity: Major
            Found in src/server/routes/entity/edition.ts and 4 other locations - About 1 hr to fix
            src/server/routes/entity/author.ts on lines 252..256
            src/server/routes/entity/edition-group.ts on lines 246..250
            src/server/routes/entity/publisher.ts on lines 258..262
            src/server/routes/entity/work.ts on lines 270..274

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

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

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

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

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

            Refactorings

            Further Reading

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

                const aliases = work.aliasSet ?
                    work.aliasSet.aliases.map(({languageId, ...rest}) => ({
                        ...rest,
                        language: languageId
                    })) : [];
            Severity: Major
            Found in src/server/routes/entity/work.ts and 4 other locations - About 1 hr to fix
            src/server/routes/entity/author.ts on lines 252..256
            src/server/routes/entity/edition-group.ts on lines 246..250
            src/server/routes/entity/edition.ts on lines 411..415
            src/server/routes/entity/publisher.ts on lines 258..262

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

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

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

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

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

            Refactorings

            Further Reading

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

                const aliases = publisher.aliasSet ?
                    publisher.aliasSet.aliases.map(({languageId, ...rest}) => ({
                        ...rest,
                        language: languageId
                    })) : [];
            Severity: Major
            Found in src/server/routes/entity/publisher.ts and 4 other locations - About 1 hr to fix
            src/server/routes/entity/author.ts on lines 252..256
            src/server/routes/entity/edition-group.ts on lines 246..250
            src/server/routes/entity/edition.ts on lines 411..415
            src/server/routes/entity/work.ts on lines 270..274

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

            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