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")
Severity: Minor
Found in MetaLinkReplaceCommand.ts - 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 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
Severity: Minor
Found in DefaultContentVisitor.ts - 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

Avoid too many return statements within this function.
Open

  return value.toExponential(1);
Severity: Major
Found in people/a/AlammarJay/js/nnVizUtils.js - About 30 mins to fix

    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']")
    Severity: Minor
    Found in DescriptionReplaceCommand.ts - About 25 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 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")
    Severity: Minor
    Found in org/eu/fr/cnes/geipan/GeipanHttpDatasource.ts - About 25 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 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')")
    Severity: Minor
    Found in extension/Shared (App)/ViewController.swift - About 25 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 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, *) {
    Severity: Minor
    Found in extension/Shared (Extension)/SafariWebExtensionHandler.swift - About 25 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 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"])
    Severity: Minor
    Found in DefaultContentVisitor.ts - About 25 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 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,
    Severity: Minor
    Found in people/a/AlammarJay/js/two_variable_nn.js - About 25 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