Showing 65 of 766 total issues
Function automaticAlignment
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export default function automaticAlignment(
tokens: readonly (readonly AnnotationToken[])[],
annotation: Annotation,
annotations: readonly Annotation[]
): readonly Annotation[] {
- 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 Highlight
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export default function Highlight({
scale,
annotation,
active,
isToggled,
- 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 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
render(): JSX.Element {
const parsed = new Parser().parse(this.state.citation)
return (
<>
<Form onSubmit={this.handleSubmit}>
Function TransliterationSearchHelp
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function TransliterationSearchHelp(): JSX.Element {
return (
<Popover
id={_.uniqueId('TransliterationSearchHelp-')}
title="Search transliterations"
Function LogogramInfo
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function LogogramInfo(schrammLogogram: string): JSX.Element {
return (
<Popover
id={_.uniqueId('LogogramInfo-')}
title="Logogram Info"
Function testDelegation
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function testDelegation<S>(
object: S,
testData: readonly TestData<S>[]
): void {
describe.each(testData)(
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render(): JSX.Element {
return (
<div className="Word">
<ErrorBoundary>
<Link
Function SignsSearchForm
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function SignsSearchForm({ sign, signQuery, history }: Props): JSX.Element {
const [signQueryState, setSignQueryState] = useState(signQuery)
const [signState, setSignState] = useState(sign || '')
const [unnormalizedSignQuery, setUnnormalizedSignQuery] = useState(
signQuery.value
- 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 ChapterLineForm
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function ChapterLineForm({
value,
manuscripts,
onChange,
disabled = false,
- 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 createColumns
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createColumns(tokens: readonly Token[]): TextLineColumn[] {
const hasColumns = containsColumns(tokens)
return _.reduce<Token, TextLineColumn[]>(
tokens,
(columns, current) => {
Function findLineVariant
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
findLineVariant(
variant: LineVariantDisplayDto,
isPrimaryVariant: boolean
): Bluebird<LineVariantDisplay> {
return Bluebird.all([
Function AlignmentForm
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function AlignmentForm(props: AlignerProps) {
const [alignment, setAlignment] = useState(props.token.alignment)
const [variant, setVariant] = useState(props.token.variant?.value ?? '')
function updateToken(alignmentToken: AlignmentToken): AlignmentToken {
- 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
Avoid deeply nested control flow statements. Open
if (checkIfNewPage(yPos, doc)) {
newPageStarted = true
doc.addPage()
yPos = 15
maxYPos.coords = 15
Function addUnderLine
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
yPos: any,
endpos: number,
num: number,
page: number,
endposFirstColumn: number,
Function getColumnSizes
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
table: JQuery,
jQueryRef: JQuery,
outerPaddingForTable: number,
firstColumnMinWidth: number,
doc: jsPDF
Function addFootnotes
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
notes: JQuery,
padding: number,
jQueryRef: JQuery,
yPos: number,
doc: jsPDF
Function createItems
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
start,
end,
activePage,
setActivePage: (number: number) => void,
paginationURLParam: string
Function getTransliterationText
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
el: HTMLElement | Text | Comment | Document,
doc: jsPDF,
xPos: number,
yPos: number,
add: boolean
Function useRowsContext
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
numberOfRows: number,
score?: boolean,
notes?: boolean,
parallels?: boolean,
oldLineNumbers?: boolean
Function addMainTableWithFootnotes
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
table: JQuery,
notes: JQuery,
jQueryRef: any,
yPos: number,
doc: any