Showing 555 of 555 total issues

Function fromInternalLink has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  protected async fromInternalLink(href: string, context: HtmlRR0SsgContext): Promise<Source> {
    if (path.dirname(href).startsWith("/")) {
      href = href.substring(1)
    }
    const hashPos = href.lastIndexOf("#")
Severity: Minor
Found in source/SourceReplacerFactory.ts - About 1 hr 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 neuralNetworkCalculationViz has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

  var neuralNetworkCalculationViz = function (inputs, inputNodeCount, outputNodeCount, activation, containerElement, weights, biases, tableElement,
                                              trainingSet, classes) {
Severity: Major
Found in people/a/AlammarJay/js/nn_calc.js - About 1 hr to fix

    Function updateTimeFromStr has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

      static updateTimeFromStr(time: TimeContext, timeStr: string) {
        const result = TimeReplacer.parseDateTime(timeStr)
        if (result) {
          const {yearStr, monthStr, dayOfMonthStr, hour, minutes, timeZone} = result
          time.setYear(parseInt(yearStr, 10))
    Severity: Minor
    Found in time/TimeReplacer.ts - About 1 hr 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 find has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

      find(context: RR0SsgContext, nameToFind: string, parent: P): Organization | undefined {
        let foundOrg = this.orgs.find(org => {
          const orgMessages = org.getMessages(context)
          assert.ok(orgMessages, `Organization with code "${org.code}" has no messages`)
          let found: boolean
    Severity: Minor
    Found in org/OrganizationService.ts - About 1 hr 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

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

        groups
          .append("ellipse")
          .attr("class", function (d) {
            if (d.type == "weight") return "outlined-weight-node nn-node"
            else if (d.type == "bias") return "outlined-bias-node nn-node"
    Severity: Major
    Found in people/a/AlammarJay/js/nn_calc.js and 2 other locations - About 1 hr to fix
    people/a/AlammarJay/js/nn_calc.js on lines 76..82
    people/a/AlammarJay/js/nn_calc.js on lines 1286..1292

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 60.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

        inputs
          .append("circle")
          .attr("class", function (d) {
            if (d.type == "input") return "outlined-input-node nn-node"
            else if (d.type == "bias") return "outlined-bias-node nn-node"
    Severity: Major
    Found in people/a/AlammarJay/js/nn_calc.js and 2 other locations - About 1 hr to fix
    people/a/AlammarJay/js/nn_calc.js on lines 227..233
    people/a/AlammarJay/js/nn_calc.js on lines 1286..1292

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 60.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

          inputs
            .append("circle")
            .attr("class", function (d) {
              if (d.type == "input") return "outlined-input-node nn-node"
              else if (d.type == "bias") return "outlined-bias-node nn-node"
    Severity: Major
    Found in people/a/AlammarJay/js/nn_calc.js and 2 other locations - About 1 hr to fix
    people/a/AlammarJay/js/nn_calc.js on lines 76..82
    people/a/AlammarJay/js/nn_calc.js on lines 227..233

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 60.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function get has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

      async get(address: string): Promise<Place | undefined> {
        let place = this.cache.get(address)
        if (!place) {
          place = await this.create(address)
          if (place) {
    Severity: Minor
    Found in place/PlaceService.ts - About 1 hr 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

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

      this.valueG.append("ellipse")
        .attr("class", "relu-value-dot activation-value-dot")
        .attr("rx", 5)
        .attr("ry", 5)
        .attr("cx", 0)
    Severity: Major
    Found in people/a/AlammarJay/js/relu_graph.js and 1 other location - About 1 hr to fix
    people/a/AlammarJay/js/sigmoid_graph.js on lines 125..130

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 60.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

      this.valueG.append("ellipse")
        .attr("class", "sigmoid-value-dot")
        .attr("rx", 5)
        .attr("ry", 5)
        .attr("cx", 0)
    Severity: Major
    Found in people/a/AlammarJay/js/sigmoid_graph.js and 1 other location - About 1 hr to fix
    people/a/AlammarJay/js/relu_graph.js on lines 125..130

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 60.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

      return {
        url, title: "cas n° " + caseNumber, authors: datasource.authors,
        publication: {publisher: datasource.copyright, time: TimeContext.fromDate(dataDate, rr0TestUtil.intlOptions)}
      }
    Severity: Major
    Found in time/datasource/nuforc/NuforcRR0Mapper.test.ts and 1 other location - About 1 hr to fix
    time/datasource/baseovnifrance/BaseOvniFranceCaseSummaryRR0Mapper.test.ts on lines 16..19

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 60.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

      return {
        url, title: "cas n° " + caseNumber, authors: datasource.authors,
        publication: {publisher: datasource.copyright, time: TimeContext.fromDate(dataDate, rr0TestUtil.intlOptions)}
      }
    time/datasource/nuforc/NuforcRR0Mapper.test.ts on lines 19..22

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 60.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

        expect(nanterreMessages.toTitle(context, nanterre92, {parent: true})).toBe(
          `${nanterreMessages.title} (${hautsDeSeineMessages.title}, ${idfMessages.title})`)
    Severity: Major
    Found in org/country/region/department/city/CityMessages.test.ts and 2 other locations - About 1 hr to fix
    org/country/region/department/DeparmentMessages.test.ts on lines 27..28
    org/country/region/department/city/CityMessages.test.ts on lines 36..37

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 60.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

        expect(castlegarMessages.toTitle(context, castlegar, {parent: true})).toBe(
          `${castlegarMessages.title} (${kootenaysMessages_fr.title}, ${britishColumbiaMessages_fr.title})`)
    Severity: Major
    Found in org/country/region/department/city/CityMessages.test.ts and 2 other locations - About 1 hr to fix
    org/country/region/department/DeparmentMessages.test.ts on lines 27..28
    org/country/region/department/city/CityMessages.test.ts on lines 38..39

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 60.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

        expect(hautsDeSeineMessages.toTitle(context, hautsDeSeine, {parent: true})).toBe(
          `${hautsDeSeineMessages.title}, ${idfMessages.title}, ${france_fr.title}`)
    Severity: Major
    Found in org/country/region/department/DeparmentMessages.test.ts and 2 other locations - About 1 hr to fix
    org/country/region/department/city/CityMessages.test.ts on lines 36..37
    org/country/region/department/city/CityMessages.test.ts on lines 38..39

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 60.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function getNativeCase has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      protected getNativeCase(context: RR0SsgContext, row: Element): AcufoCase {
        const fields = row.querySelectorAll("td")
        const caseLink = fields[0].firstElementChild as HTMLAnchorElement
        const dateFormat = /(\d\d)\/(\d\d)\/(\d\d\d\d) (\d\d):(\d\d)/
        const dateFields = dateFormat.exec(fields[1].textContent)
    Severity: Minor
    Found in time/datasource/acufo/AcufoDatasource.ts - About 1 hr to fix

      Function aggregate has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        protected async aggregate(context: HtmlRR0SsgContext, element: HTMLUListElement) {
          const existingItems = Array.from(element.children)
          // TODO: Get cases from local RR0, not the remote one
          const existingCases = this.rr0Datasource.getFromRows(context, existingItems)
          const casesToAdd: RR0CaseSummary[] = []
      Severity: Minor
      Found in time/datasource/ChronologyReplacer.ts - About 1 hr to fix

        Function gradientDescentStep has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        NN_trainer.prototype.gradientDescentStep = function (number_of_steps) {
        
          // I probably shouldn't do this. I started doing feature normalization so we can keep to one learning rate.
          // I decided to do it this way to maintain narrative continuity.
          this.learningRate = 0.00000001;
        Severity: Minor
        Found in people/a/AlammarJay/js/simple_nn.js - About 1 hr to fix

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

            this.errorYAxis = this.errorG.append("g")
              .attr("class", "axis axis--y")
              .call(d3.axisLeft(this.error_y).ticks(5));
          Severity: Major
          Found in people/a/AlammarJay/js/two_variable_nn.js and 1 other location - About 1 hr to fix
          people/a/AlammarJay/js/simple_nn.js on lines 232..234

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 59.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

            this.errorYAxis = this.errorG.append("g")
              .attr("class", "axis axis--y")
              .call(d3.axisLeft(this.error_y).ticks(5));
          Severity: Major
          Found in people/a/AlammarJay/js/simple_nn.js and 1 other location - About 1 hr to fix
          people/a/AlammarJay/js/two_variable_nn.js on lines 143..145

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 59.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Severity
          Category
          Status
          Source
          Language