bookbrainz/bookbrainz-site

View on GitHub

Showing 1,033 of 1,033 total issues

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

                    <Row>
                        <Col lg={lgCol}>
                            <Form.Group>
                                <Form.Label>Deprecated</Form.Label>
                                <Form.Control
Severity: Major
Found in src/client/components/forms/type-editor/identifier-type.tsx and 1 other location - About 6 hrs to fix
src/client/components/forms/type-editor/relationship-type.tsx on lines 408..424

Duplicated Code

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

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

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

Tuning

This issue has a mass of 169.

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

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

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

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

Refactorings

Further Reading

File relationship-type.tsx has 444 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Copyright (C) 2023 Shivam Awasthi
 *
 * 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/components/forms/type-editor/relationship-type.tsx - About 6 hrs to fix

    Function render has 163 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        render() {
            if (this.state.collaborators.length === 0) {
                this.handleAddCollaborator();
            }
    
    
    Severity: Major
    Found in src/client/components/forms/userCollection.js - About 6 hrs to fix

      Function AboutPage has 162 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function AboutPage(): JSX.Element {
          const NESLink =
              'https://ocharles.org.uk/blog/posts/' +
                  '2012-07-10-nes-does-it-better-1.html';
      
      
      Severity: Major
      Found in src/client/components/pages/about.tsx - About 6 hrs to fix

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

            if (typeof baseEntity.bbid === 'undefined') {
                _.forEach(relationshipsObject, relationship => {
                    const {sourceEntity, targetEntity} = relationship;
                    const defaultAliasPath = ['defaultAlias', 'name'];
                    const newEntity = [sourceEntity, targetEntity].find(({bbid}) => bbid === baseEntity.bbid);
        src/client/entity-editor/series-section/series-section.tsx on lines 130..141

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

        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 (typeof baseEntity.bbid === 'undefined') {
                _.forEach(seriesItemsObject, relationship => {
                    const {sourceEntity, targetEntity} = relationship;
                    const defaultAliasPath = ['defaultAlias', 'name'];
                    const newEntity = [sourceEntity, targetEntity].find(({bbid}) => bbid === baseEntity.bbid);
        Severity: Major
        Found in src/client/entity-editor/series-section/series-section.tsx and 1 other location - About 6 hrs to fix
        src/client/entity-editor/relationship-editor/relationship-section.tsx on lines 165..176

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

        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 relationship-editor.tsx has 425 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*
         * Copyright (C) 2018  Ben Ockmore
         *                 2021  Akash Gupta
         * 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/relationship-editor/relationship-editor.tsx - About 6 hrs to fix

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

                              <Row>
                                  <Col lg={lgCol}>
                                      <Form.Group>
                                          <Form.Label>Entity Type</Form.Label>
                                          <ReactSelect
          Severity: Major
          Found in src/client/components/forms/type-editor/identifier-type.tsx and 2 other locations - About 6 hrs to fix
          src/client/components/forms/type-editor/relationship-type.tsx on lines 322..338
          src/client/components/forms/type-editor/relationship-type.tsx on lines 339..355

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 156.

          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

                              <Row>
                                  <Col lg={lgCol}>
                                      <Form.Group>
                                          <Form.Label>Target Entity Type</Form.Label>
                                          <ReactSelect
          src/client/components/forms/type-editor/identifier-type.tsx on lines 283..299
          src/client/components/forms/type-editor/relationship-type.tsx on lines 322..338

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

          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

                              <Row>
                                  <Col lg={lgCol}>
                                      <Form.Group>
                                          <Form.Label>Source Entity Type</Form.Label>
                                          <ReactSelect
          src/client/components/forms/type-editor/identifier-type.tsx on lines 283..299
          src/client/components/forms/type-editor/relationship-type.tsx on lines 339..355

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 156.

          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

                          <Row>
                              <Col lg={8}>
                                  <EntityLinks
                                      entity={entity}
                                      identifierTypes={identifierTypes}
          Severity: Major
          Found in src/client/components/pages/entities/series.js and 2 other locations - About 6 hrs to fix
          src/client/components/pages/entities/edition-group.js on lines 141..160
          src/client/components/pages/entities/work.js on lines 135..153

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

          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

                          <Row>
                              <Col lg={8}>
                                  <EntityLinks
                                      entity={entity}
                                      identifierTypes={identifierTypes}
          Severity: Major
          Found in src/client/components/pages/entities/work.js and 2 other locations - About 6 hrs to fix
          src/client/components/pages/entities/edition-group.js on lines 141..160
          src/client/components/pages/entities/series.js on lines 140..158

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

          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

                          <Row>
                              <Col lg={8}>
                                  <EntityLinks
                                      entity={entity}
                                      identifierTypes={identifierTypes}
          Severity: Major
          Found in src/client/components/pages/entities/edition-group.js and 2 other locations - About 6 hrs to fix
          src/client/components/pages/entities/series.js on lines 140..158
          src/client/components/pages/entities/work.js on lines 135..153

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

          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

          function cleanupFunction() {
              return new Promise((resolve, reject) => {
                  debug('Cleaning up before closing');
                  server.close((err) => {
                      if (err) {
          Severity: Major
          Found in src/api/app.js and 1 other location - About 5 hrs to fix
          src/server/app.js on lines 179..199

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

          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

          function cleanupFunction() {
              return new Promise((resolve, reject) => {
                  debug('Cleaning up before closing');
                  server.close((err) => {
                      if (err) {
          Severity: Major
          Found in src/server/app.js and 1 other location - About 5 hrs to fix
          src/api/app.js on lines 79..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 154.

          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 eslint.config.js has 414 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* eslint-disable comma-dangle */
          /* eslint-disable quotes */
          import pluginImport from 'eslint-plugin-import';
          import pluginNode from 'eslint-plugin-node';
          import pluginReact from 'eslint-plugin-react';
          Severity: Minor
          Found in eslint.config.js - About 5 hrs to fix

            Function renderLoggedInDropdown has 147 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                renderLoggedInDropdown() {
                    const {user} = this.props;
            
                    const createDropdownTitle = (
                        <span>
            Severity: Major
            Found in src/client/containers/layout.js - About 5 hrs to fix

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

                  if (privsRemoved.length) {
                      removedStatement = ' removed ';
                      const lastItem = privsRemoved.at(-1);
                      const otherPrivs = privsRemoved.slice(0, -1);
                      if (otherPrivs.length) {
              Severity: Major
              Found in src/client/helpers/adminLogs.tsx and 1 other location - About 5 hrs to fix
              src/client/helpers/adminLogs.tsx on lines 48..61

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

              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 (privsAdded.length) {
                      grantStatement = ' granted ';
                      const lastItem = privsAdded.at(-1);
                      const otherPrivs = privsAdded.slice(0, -1);
                      if (otherPrivs.length) {
              Severity: Major
              Found in src/client/helpers/adminLogs.tsx and 1 other location - About 5 hrs to fix
              src/client/helpers/adminLogs.tsx on lines 65..78

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

              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

                                  <thead>
                                      <tr>
                                          {publishers[0].displayNumber && <th style={{width: '10%'}}>#</th>}
                                          <th>Name</th>
                                          <th>Area</th>
              Severity: Major
              Found in src/client/components/pages/entities/publisher-table.js and 1 other location - About 5 hrs to fix
              src/client/components/pages/entities/author-table.js on lines 88..100

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

              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