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

    handleMonthChange = (event) => {
        const month = event.target.value;
        this.setState(
            {month},
            this.setStateCallback
Severity: Minor
Found in src/client/entity-editor/common/new-date-field.js and 1 other location - About 40 mins to fix
src/client/entity-editor/common/new-date-field.js on lines 41..47

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

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

type StateProps = {
    areaValue: Map<string, any>,
    beginDateValue: string,
    endDateValue: string,
    endedChecked: boolean,
src/client/entity-editor/publisher-section/publisher-section-merge.tsx on lines 53..59

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

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

type StateProps = {
    areaValue: Map<string, any>,
    beginDateValue: string,
    endDateValue: string,
    endedChecked: boolean,
src/client/entity-editor/publisher-section/publisher-section.tsx on lines 57..63

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

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 {Alert, Button, Col, Form, Row, OverlayTrigger, Tooltip, Card} = bootstrap;
Severity: Minor
Found in src/client/components/forms/deletion.js and 1 other location - About 40 mins to fix
src/client/containers/layout.js on lines 42..42

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

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

            <p>
                You can also get in touch and discuss with the community
                <a href="https://community.metabrainz.org/c/bookbrainz"> on our forums,</a>
                &nbsp;or send us
                <a href="mailto:bookbrainz@metabrainz.org"> an email.</a>
Severity: Minor
Found in src/client/components/pages/contribute.tsx and 1 other location - About 40 mins to fix
src/client/components/pages/contribute.tsx on lines 72..85

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

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

    handleYearChange = (event) => {
        const year = event.target.value;
        this.setState(
            {year},
            this.setStateCallback
Severity: Minor
Found in src/client/entity-editor/common/new-date-field.js and 1 other location - About 40 mins to fix
src/client/entity-editor/common/new-date-field.js on lines 49..55

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

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

export function addAliasRow(): Action {
    /*
     * Prepend 'n' here to indicate new alias, and avoid conflicts with IDs of
     * existing aliases.
     */
Severity: Minor
Found in src/client/entity-editor/alias-editor/actions.ts and 2 other locations - About 40 mins to fix
src/client/entity-editor/author-credit-editor/actions.ts on lines 68..77
src/client/entity-editor/identifier-editor/actions.ts on lines 58..67

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

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

                <div>
                    <strong>Reverse Phrase:&nbsp;</strong>{parent.targetEntityType}&nbsp;{parent.reverseLinkPhrase}&nbsp;{parent.sourceEntityType}
                </div>
Severity: Minor
Found in src/client/components/forms/type-editor/typeUtils.tsx and 1 other location - About 40 mins to fix
src/client/components/forms/type-editor/typeUtils.tsx on lines 107..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 48.

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

router.get('/:bbid', middleware.loadEntityRelationships, middleware.loadWikipediaExtract, (req, res) => {
    _setWorkTitle(res);
    entityRoutes.displayEntity(req, res);
});
Severity: Minor
Found in src/server/routes/entity/work.ts and 1 other location - About 40 mins to fix
src/server/routes/entity/author.ts on lines 213..216

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

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

                <div>
                    <strong>Forward Phrase:&nbsp;</strong>{parent.sourceEntityType}&nbsp;{parent.linkPhrase}&nbsp;{parent.targetEntityType}
                </div>
Severity: Minor
Found in src/client/components/forms/type-editor/typeUtils.tsx and 1 other location - About 40 mins to fix
src/client/components/forms/type-editor/typeUtils.tsx on lines 110..112

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

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

export function addIdentifierRow(): Action {
    /*
     * Prepend 'n' here to indicate new identifier, and avoid conflicts with IDs
     * of existing identifiers.
     */
Severity: Minor
Found in src/client/entity-editor/identifier-editor/actions.ts and 2 other locations - About 40 mins to fix
src/client/entity-editor/alias-editor/actions.ts on lines 125..134
src/client/entity-editor/author-credit-editor/actions.ts on lines 68..77

Duplicated Code

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

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

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

Tuning

This issue has a mass of 48.

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

router.get('/:bbid', middleware.loadEntityRelationships, middleware.loadWikipediaExtract, (req, res) => {
    _setAuthorTitle(res);
    entityRoutes.displayEntity(req, res);
});
Severity: Minor
Found in src/server/routes/entity/author.ts and 1 other location - About 40 mins to fix
src/server/routes/entity/work.ts on lines 232..235

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

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

export function addAuthorCreditRow(): Action {
    /*
     * Prepend 'n' here to indicate a new row, and avoid conflicts with IDs of
     * existing author credit rows.
     */
Severity: Minor
Found in src/client/entity-editor/author-credit-editor/actions.ts and 2 other locations - About 40 mins to fix
src/client/entity-editor/alias-editor/actions.ts on lines 125..134
src/client/entity-editor/identifier-editor/actions.ts on lines 58..67

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

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

            <p>
                If you&rsquo;re someone who&rsquo;s good at using
                JavaScript, NodeJS, SQL or LESS/SASS, we&rsquo;d love to
                have your help developing BookBrainz. Take a look at our&nbsp;
                <a href="https://wiki.musicbrainz.org/Development/Priorities#BookBrainz">
Severity: Minor
Found in src/client/components/pages/contribute.tsx and 1 other location - About 40 mins to fix
src/client/components/pages/contribute.tsx on lines 96..101

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

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 getNextAnnotation has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    orm, transacting, currentEntity, body, revision
Severity: Minor
Found in src/server/routes/entity/entity.tsx - About 35 mins to fix

    Function generateEntityProps has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        entityType: string,
        req: PassportRequest, res: $Response,
        additionalProps: any,
        initialStateCallback: (entity: any) => any = () => new Object()
    Severity: Minor
    Found in src/server/helpers/entityRouteUtils.tsx - About 35 mins to fix

      Function fetchOrCreateMainEntity has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          orm, transacting, isNew, bbid, entityType
      Severity: Minor
      Found in src/server/routes/entity/entity.tsx - About 35 mins to fix

        Function searchOption has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        export async function searchOption(orm, type:string, query:string, idKey = 'id', exactMatch = false):Promise<{
        Severity: Minor
        Found in src/server/helpers/utils.ts - About 35 mins to fix

          Function handleCreateOrEditEntity has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              req: PassportRequest,
              res: $Response,
              entityType: EntityTypeString,
              derivedProps: Record<string, unknown>,
              isMergeOperation: boolean
          Severity: Minor
          Found in src/server/routes/entity/entity.tsx - About 35 mins to fix

            Function _createNote has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function _createNote(orm, content, editorID, revision, transacting) {
            Severity: Minor
            Found in src/server/routes/entity/entity.tsx - About 35 mins to fix
              Severity
              Category
              Status
              Source
              Language