bookbrainz/bookbrainz-site

View on GitHub

Showing 365 of 1,033 total issues

Function SortNameField has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

function SortNameField({
    empty,
    error,
    onChange,
    storedNameValue,
Severity: Minor
Found in src/client/entity-editor/common/sort-name-field.tsx - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function AuthorCreditSection has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

function AuthorCreditSection({
    authorCreditEditor: immutableAuthorCreditEditor, onEditAuthorCredit, onEditorClose,
    showEditor, onAuthorChange, isEditable, authorCreditEnable, toggleAuthorCreditEnable,
    onClearHandler, isUnifiedForm, isLeftAlign, ...rest
}: Props) {
Severity: Minor
Found in src/client/entity-editor/author-credit-editor/author-credit-section.tsx - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

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

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

                  orm: any, req: PassportRequest, res: $Response, HeaderModel: any,
                  RevisionModel: any
              Severity: Minor
              Found in src/server/routes/entity/entity.tsx - About 35 mins to fix

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

                    orm: any,
                    currentEntity: Record<string, unknown> | null | undefined,
                    entityType: EntityTypeString,
                    body: any,
                    transacting: Transaction
                Severity: Minor
                Found in src/server/routes/entity/entity.tsx - About 35 mins to fix

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

                  export async function getOrderedRevisionsForEntityPage(orm: any, from: number, size: number, RevisionModel, bbid: string) {
                  Severity: Minor
                  Found in src/server/helpers/revisions.ts - About 35 mins to fix

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

                    function generateRel(workEntity, seriesEntity, attributeSetId?, isAdded = false, isRemoved = false) {
                    Severity: Minor
                    Found in src/client/unified-form/content-tab/content-tab.tsx - About 35 mins to fix

                      Function AuthorTableRow has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function AuthorTableRow({author, showAddedAtColumn, showCheckboxes, selectedEntities, onToggleRow, genderOptions}) {
                          const name = getEntityLabel(author);
                          const disambiguation = getEntityDisambiguation(author);
                          const number = author.number || '?';
                          const authorType = author.authorType?.label || author.authorType || '?';
                      Severity: Minor
                      Found in src/client/components/pages/entities/author-table.js - About 35 mins to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Function formatAlias has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function formatAlias(change) {
                          const aliasSetAdded =
                              change.kind === 'N' && _.isEqual(change.path, ['aliasSet']);
                          if (aliasSetAdded) {
                              return formatNewAliasSet(change);
                      Severity: Minor
                      Found in src/server/helpers/diffFormatters/entity.js - About 35 mins to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Function render has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          render() {
                              let reviewContent;
                              const mapEntityType = {
                                  Author: 'author',
                                  EditionGroup: 'edition-group',
                      Severity: Minor
                      Found in src/client/components/pages/entities/cb-review.js - About 35 mins to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Function EditionDisplayPage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function EditionDisplayPage({entity, identifierTypes, user, wikipediaExtract}) {
                          // relationshipTypeId = 10 refers the relation (<Work> is contained by <Edition>)
                          const relationshipTypeId = 10;
                          const worksContainedByEdition = getRelationshipTargetByTypeId(entity, relationshipTypeId);
                          const worksContainedByEditionWithAuthors = addAuthorsDataToWorks(entity.authorsData, worksContainedByEdition);
                      Severity: Minor
                      Found in src/client/components/pages/entities/edition.js - About 35 mins to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Function PublisherTableRow has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function PublisherTableRow({showAddedAtColumn, publisher, showCheckboxes, selectedEntities, onToggleRow}) {
                          const name = getEntityLabel(publisher);
                          const number = publisher.number || '?';
                          const disambiguation = getEntityDisambiguation(publisher);
                          const publisherType = publisher.publisherType ? publisher.publisherType.label : '?';
                      Severity: Minor
                      Found in src/client/components/pages/entities/publisher-table.js - About 35 mins to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Function WorkTableRow has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function WorkTableRow({showAddedAtColumn, work, showCheckboxes, selectedEntities, onToggleRow}) {
                          const name = getEntityLabel(work);
                          const authorData = work.authorsData;
                          const number = work.number || '?';
                          const disambiguation = getEntityDisambiguation(work);
                      Severity: Minor
                      Found in src/client/components/pages/entities/work-table.js - About 35 mins to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Function render has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

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

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Function RevisionsTable has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function RevisionsTable(props) {
                          const {results, showEntities, showRevisionNote, showRevisionEditor, tableHeading} = props;
                          return (
                              <div>
                                  <div>
                      Severity: Minor
                      Found in src/client/components/pages/parts/revisions-table.js - About 35 mins to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Severity
                      Category
                      Status
                      Source
                      Language