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,
- Read upRead up
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) {
- Read upRead up
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
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()
Function fetchOrCreateMainEntity
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
orm, transacting, isNew, bbid, entityType
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<{
Function handleCreateOrEditEntity
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
req: PassportRequest,
res: $Response,
entityType: EntityTypeString,
derivedProps: Record<string, unknown>,
isMergeOperation: boolean
Function _createNote
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function _createNote(orm, content, editorID, revision, transacting) {
Function handleDelete
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
orm: any, req: PassportRequest, res: $Response, HeaderModel: any,
RevisionModel: any
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
Function getOrderedRevisionsForEntityPage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export async function getOrderedRevisionsForEntityPage(orm: any, from: number, size: number, RevisionModel, bbid: string) {
Function generateRel
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function generateRel(workEntity, seriesEntity, attributeSetId?, isAdded = false, isRemoved = false) {
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 || '?';
- Read upRead up
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);
- Read upRead up
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',
- Read upRead up
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);
- Read upRead up
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 : '?';
- Read upRead up
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);
- Read upRead up
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();
}
- Read upRead up
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>
- Read upRead up
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"