bookbrainz/bookbrainz-site

View on GitHub

Showing 1,033 of 1,033 total issues

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

                        <ListGroup.Item><b><a href="https://musicbrainz.org/doc/Disambiguation_Comment">Disambiguation</a></b> – Short comment added to differentiate between similarly-named entities.
                            <br/>
                            Example:
                            <ul>
                                <li>The Alchemist (philosophical novel) by Paulo Coelho</li>
Severity: Major
Found in src/client/components/pages/help.tsx and 1 other location - About 3 hrs to fix
src/client/components/pages/help.tsx on lines 115..122

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

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

                        <ListGroup.Item><b><a href="https://musicbrainz.org/doc/Aliases">Aliases</a></b> – Variant names for an entity such as alternate spelling, different script, stylistic representation, acronyms, etc.
                            <br/>
                            Example:
                            <ul>
                                <li>Name: 村上 春樹 – Alias (english): Haruki Murakami</li>
Severity: Major
Found in src/client/components/pages/help.tsx and 1 other location - About 3 hrs to fix
src/client/components/pages/help.tsx on lines 126..133

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

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

File edition-group.ts has 291 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Copyright (C) 2015       Ben Ockmore
 *               2015-2016  Sean Burke
 *
 * This program is free software; you can redistribute it and/or modify
Severity: Minor
Found in src/server/routes/entity/edition-group.ts - About 3 hrs to fix

    File entity.tsx has 291 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
     * Copyright (C) 2016  Daniel Hsing
     *                  2019  Akhilesh Kumar (@akhilesh26)
     *
     * This program is free software; you can redistribute it and/or modify
    Severity: Minor
    Found in src/client/helpers/entity.tsx - About 3 hrs to fix

      Function renderBasicInfo has 74 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          renderBasicInfo() {
              const {user, editor} = this.props;
              const {
                  cachedMetabrainzName,
                  metabrainzUserId,
      Severity: Major
      Found in src/client/components/pages/parts/editor-profile.js - About 2 hrs to fix

        Function ContributePage has 74 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function ContributePage(): JSX.Element {
            const IRCLink = 'https://kiwiirc.com/nextclient/irc.libera.chat/?#bookbrainz';
            const styleLink = 'https://bookbrainz-user-guide.readthedocs.io/';
        
            return (
        Severity: Major
        Found in src/client/components/pages/contribute.tsx - About 2 hrs to fix

          File edition-section-merge.tsx has 290 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*
           * Copyright (C) 2019 Nicolas Pelletier
           *
           * This program is free software; you can redistribute it and/or modify
           * it under the terms of the GNU General Public License as published by
          Severity: Minor
          Found in src/client/entity-editor/edition-section/edition-section-merge.tsx - About 2 hrs to fix

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

                (req, res, next) => {
                    // As we're loading the browsed entity, also load the related EditionGroups from the ORM models to avoid fetching it twice
                    let extraRelationships = [];
                    if (req.query.modelType === 'Edition') {
                        extraRelationships = editionGroupBasicRelations.map(rel => `editionGroup.${rel}`);
            Severity: Major
            Found in src/api/routes/edition-group.js and 1 other location - About 2 hrs to fix
            src/api/routes/publisher.js on lines 330..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 94.

            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

                (req, res, next) => {
                    // As we're loading the browsed entity, also load the related Publishers from the ORM models to avoid fetching it twice
                    let extraRelationships = [];
                    if (req.query.modelType === 'Edition') {
                        extraRelationships = publisherBasicRelations.map(rel => `publisherSet.publishers.${rel}`);
            Severity: Major
            Found in src/api/routes/publisher.js and 1 other location - About 2 hrs to fix
            src/api/routes/edition-group.js on lines 289..296

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

            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 checkboxLabel = (
                    <>
                        <FormLabel className="font-weight-normal">
                        This Edition doesn&apos;t have an Author
                            <OverlayTrigger
            src/client/unified-form/content-tab/content-tab.tsx on lines 144..161

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

            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

                                <Row>
                                    <Col lg={lgCol}>
                                        <DateField
                                            show
                                            defaultValue={endDateValue}
            src/client/entity-editor/publisher-section/publisher-section.tsx on lines 171..184

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

            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 seriesWorkLabel = (
            
                    <>
                        <FormLabel className="font-weight-normal">
                        Add Works to Series
            Severity: Major
            Found in src/client/unified-form/content-tab/content-tab.tsx and 1 other location - About 2 hrs to fix
            src/client/entity-editor/author-credit-editor/author-credit-section.tsx on lines 121..140

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

            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

                        <Row>
                            <Col lg={lgCol}>
                                <DateField
                                    show
                                    defaultValue={beginDateValue}
            src/client/entity-editor/publisher-section/publisher-section.tsx on lines 195..208

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

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

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

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

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

            Refactorings

            Further Reading

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

                if (size > 2) {
                    // Third to last author credit
                    const name2Key = keys[size - 3];
                    const name2 = acNames[name2Key];
                    if (name2 && name2.automaticJoinPhrase !== false &&
            Severity: Major
            Found in src/client/entity-editor/author-credit-editor/reducer.ts and 1 other location - About 2 hrs to fix
            src/client/entity-editor/author-credit-editor/reducer.ts on lines 61..69

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

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

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

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

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

            Refactorings

            Further Reading

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

                if (size > 1) {
                    // Second to last author credit
                    const name1Key = keys[size - 2];
                    const name1 = acNames[name1Key];
                    if (name1 && name1.automaticJoinPhrase !== false &&
            Severity: Major
            Found in src/client/entity-editor/author-credit-editor/reducer.ts and 1 other location - About 2 hrs to fix
            src/client/entity-editor/author-credit-editor/reducer.ts on lines 71..79

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

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

                render() {
                    const noResults = !this.props.results || this.props.results.length === 0;
                    const results = this.props.results.map((result) => {
                        if (!result) {
                            return null;
            Severity: Major
            Found in src/client/components/pages/parts/admin-panel-search-results.tsx - About 2 hrs to fix

              File author.ts has 286 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*
               * Copyright (C) 2015       Ben Ockmore
               *               2015-2016  Sean Burke
               *
               * This program is free software; you can redistribute it and/or modify
              Severity: Minor
              Found in src/server/routes/entity/author.ts - About 2 hrs to fix

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

                                    <Col lg={3}>
                                        <dl>
                                            <dt>{endDateLabel}</dt>
                                            <dd>{endDate}</dd>
                                            <dt>{endAreaLabel}</dt>
                Severity: Major
                Found in src/client/components/pages/entities/author.js and 1 other location - About 2 hrs to fix
                src/client/components/pages/entities/author.js on lines 92..99

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

                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

                                <Col lg={3}>
                                    <dl>
                                        <dt>{beginDateLabel}</dt>
                                        <dd>{beginDate}</dd>
                                        <dt>{beginAreaLabel}</dt>
                Severity: Major
                Found in src/client/components/pages/entities/author.js and 1 other location - About 2 hrs to fix
                src/client/components/pages/entities/author.js on lines 102..109

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

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

                    render() {
                        const {collection} = this.props;
                        // eslint-disable-next-line one-var
                        let modalBody, modalTitle, submitButton;
                        if (this.props.isDelete) {
                  Severity
                  Category
                  Status
                  Source
                  Language