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

export function removeSeriesItem(rowID: string): Action {
    return {
        payload: {rowID},
        type: REMOVE_SERIES_ITEM
    };
Severity: Minor
Found in src/client/entity-editor/series-section/actions.ts and 1 other location - About 35 mins to fix
src/client/entity-editor/series-section/actions.ts on lines 54..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 46.

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 {contextEntity, link, relationshipType, sourceEntity, attributes, showAttributes, targetEntity, ...rest} = props;
Severity: Minor
Found in src/client/entity-editor/relationship-editor/relationship.tsx and 1 other location - About 35 mins to fix
src/client/unified-form/common/search-entity-create-select.tsx on lines 25..25

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

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 handleClick = useCallback((event) => {
        const identifierTypeId = parseInt(event.target.value, 10);
        toggleExpand(identifierTypeId);
    }, []);
Severity: Minor
Found in src/client/components/pages/parts/identifier-types-tree.tsx and 1 other location - About 35 mins to fix
src/client/components/pages/parts/relationship-types-tree.tsx on lines 43..46

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

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 SearchButton = (
    <Button
        block
        type="submit"
        variant="success"
Severity: Minor
Found in src/client/components/pages/parts/admin-panel-search-field.tsx and 1 other location - About 35 mins to fix
src/client/components/pages/parts/search-field.tsx on lines 32..40

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

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 SearchButton = (
    <Button
        block
        type="submit"
        variant="success"
Severity: Minor
Found in src/client/components/pages/parts/search-field.tsx and 1 other location - About 35 mins to fix
src/client/components/pages/parts/admin-panel-search-field.tsx on lines 30..38

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

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 newLanguageSet = await orm.func.language.updateLanguageSet(
        orm, transacting, oldLanguageSet,
        languages.map((languageID) => ({id: languageID}))
    );
Severity: Minor
Found in src/server/routes/entity/entity.tsx and 1 other location - About 35 mins to fix
src/server/routes/entity/entity.tsx on lines 772..775

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

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 updateArea(newArea: Area | null | undefined): Action {
    return {
        payload: newArea,
        type: UPDATE_AREA
    };
Severity: Minor
Found in src/client/entity-editor/publisher-section/actions.ts and 2 other locations - About 35 mins to fix
src/client/entity-editor/author-section/actions.ts on lines 93..98
src/client/entity-editor/author-section/actions.ts on lines 123..128

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

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 {type, nextId, onModalOpen, onModalClose, onSubmitEntity, rowId, onOpenCallback, ...rest} = props;
Severity: Minor
Found in src/client/unified-form/common/search-entity-create-select.tsx and 1 other location - About 35 mins to fix
src/client/entity-editor/relationship-editor/relationship.tsx on lines 58..58

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

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

Avoid too many return statements within this function.
Open

    return null;
Severity: Major
Found in src/server/helpers/diffFormatters/entity.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return baseFormatter.formatScalarChange(
                change, _.startCase(change.path[0])
            );
    Severity: Major
    Found in src/server/routes/revision.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return formatChangedAnnotation(change);
      Severity: Major
      Found in src/server/helpers/diffFormatters/entity.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return {errorMessage: 'Month is not valid', isValid: false};
        Severity: Major
        Found in src/client/entity-editor/validators/date.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return null;
          Severity: Major
          Found in src/server/helpers/diffFormatters/entity.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return authorCreditFormatter.format(change);
            Severity: Major
            Found in src/server/helpers/diffFormatters/entity.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return baseFormatter.formatAreaChange(change, 'End Area');
              Severity: Major
              Found in src/server/routes/revision.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return baseFormatter.formatScalarChange(change, 'Page Count');
                Severity: Major
                Found in src/server/routes/revision.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return null;
                  Severity: Major
                  Found in src/server/routes/revision.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return error.sendErrorAsJSON(res, new error.FormSubmissionError(
                                'Something went wrong when registering, please try again!'
                            ));
                    Severity: Major
                    Found in src/server/routes/register.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return {errorMessage: 'Day is not valid', isValid: false};
                      Severity: Major
                      Found in src/client/entity-editor/validators/date.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return {errorMessage: 'Day is not valid for this month', isValid: false};
                        Severity: Major
                        Found in src/client/entity-editor/validators/date.js - About 30 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language