Showing 109 of 313 total issues
Function execute
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async execute(context: C): Promise<void> {
const file = context.file
const dom = file.dom
const doc = file.document
const ul = doc.querySelector("nav ul")
- 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 processBirth
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected async processBirth(context: HtmlRR0SsgContext, event: RR0Data, entity: RR0Data) {
const parentEl = context.file.document.querySelector(".contents")
if (parentEl) {
const {eventP, timeEl} = this.timeParagraph(context, event)
const name = entity.surname ? `"${entity.surname}"` : entity.name || entity.title
- 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 too many return
statements within this function. Open
return value.toExponential(1);
Function execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async execute(context: HtmlRR0SsgContext): Promise<void> {
const file = context.file
const inDescription = file.meta.description
const outDoc = file.document
let descriptionMeta = outDoc.head.querySelector("meta[name='description']")
- 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 getFromRow
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected getFromRow(context: RR0SsgContext, row: Element): GeipanCaseSummary {
const linkField = row.querySelector(".fiche-download-icon")
const caseLink = linkField.firstElementChild as HTMLAnchorElement
const url = new URL(caseLink.href, this.baseUrl)
const caseField = row.querySelector(".cas_title")
- 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 webView
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
#if os(iOS)
webView.evaluateJavaScript("show('ios')")
#elseif os(macOS)
webView.evaluateJavaScript("show('mac')")
- 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 beginRequest
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
func beginRequest(with context: NSExtensionContext) {
let request = context.inputItems.first as? NSExtensionItem
let profile: UUID?
if #available(iOS 17.0, macOS 14.0, *) {
- 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 visit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async visit(context: HtmlRR0SsgContext) {
const dirName = path.dirname(context.file.name)
const dataList = await this.service.getFromDir(dirName,
["people", "case", "sighting", "api", "product", "org"],
["index.json", "case.json", "people.json", "api.json", "org.json"])
- 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 multiVariableNeuralNetworkTrainer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
var multiVariableNeuralNetworkTrainer = function (numberOfInputNodes,
svg_el, table_el,
dataPoints, labels,
weights, bias,
gradientDescentButton, gradientDescent10Button, gradientDescent100Button,
- 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"