Showing 670 of 670 total issues

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

    Avoid too many return statements within this function.
    Open

        return (s, False)
    Severity: Major
    Found in time/datasource/sceau/naming_conventions_files.py - About 30 mins to fix

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

        this.errorGraphScale = d3.scaleLinear()
          .domain([400, 10000, 100000, 1000000])
          .range(this.errorGraphScaleColors);
      Severity: Minor
      Found in people/a/AlammarJay/js/two_variable_nn.js and 1 other location - About 30 mins to fix
      people/a/AlammarJay/js/simple_nn.js on lines 214..216

      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 45.

      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.errorGraphScale = d3.scaleLinear()
          .domain([400, 10000, 100000, 1000000])
          .range(this.errorGraphScaleColors);
      Severity: Minor
      Found in people/a/AlammarJay/js/simple_nn.js and 1 other location - About 30 mins to fix
      people/a/AlammarJay/js/two_variable_nn.js on lines 125..127

      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 45.

      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

            try {
              this.date = EdtfDate.fromString(timeStr)
              this.duration = undefined
              this.interval = undefined
            } catch (e) {
      Severity: Minor
      Found in time/TimeContext.ts and 2 other locations - About 30 mins to fix
      time/TimeContext.ts on lines 101..113
      time/TimeContext.ts on lines 106..112

      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 45.

      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

            output.contents = output.contents.replace(`<!--#echo var="occupations" -->`,
              HtmlTag.toString("div", occupationsHtml, {id: "occupations"}))
      Severity: Minor
      Found in people/PeopleDirectoryStep.ts and 1 other location - About 30 mins to fix
      people/PeopleDirectoryStep.ts on lines 62..63

      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 45.

      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

          expect(datasource.getWitnesses("Walter Lopez, Omar Ferlatti, une bergère")).toEqual([
            {name: "Walter Lopez"}, {name: "Omar Ferlatti"}, {name: "une bergère"}
          ])
      Severity: Minor
      Found in time/datasource/urecat/UrecatDatasource.test.ts and 1 other location - About 30 mins to fix
      time/datasource/urecat/UrecatDatasource.test.ts on lines 58..60

      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 45.

      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

      export function franceDepartment(code: FranceDepartementCode, region: Region, place: Place) {
        return Department.create(code, region, place)
      }
      Severity: Minor
      Found in org/eu/fr/region/FranceDepartments.ts and 2 other locations - About 30 mins to fix
      org/ru/region/RussiaDepartment.ts on lines 6..8
      org/uk/region/UkDepartment.ts on lines 6..8

      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 45.

      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

              try {
                this.interval = EdtfInterval.fromString(timeStr)
                this.date = undefined
                this.duration = undefined
              } catch (e) {
      Severity: Minor
      Found in time/TimeContext.ts and 2 other locations - About 30 mins to fix
      time/TimeContext.ts on lines 96..114
      time/TimeContext.ts on lines 106..112

      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 45.

      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

      export function russiaDepartment(code: RussiaDepartementCode, region: Region, place: Place) {
        return Department.create(code, region, place)
      }
      Severity: Minor
      Found in org/ru/region/RussiaDepartment.ts and 2 other locations - About 30 mins to fix
      org/eu/fr/region/FranceDepartments.ts on lines 41..43
      org/uk/region/UkDepartment.ts on lines 6..8

      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 45.

      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

          expect(datasource.getWitnesses("Une femme et ses deux enfants")).toEqual([
            {name: "Une femme"}, {name: "enfant 1"}, {name: "enfant 2"}
          ])
      Severity: Minor
      Found in time/datasource/urecat/UrecatDatasource.test.ts and 1 other location - About 30 mins to fix
      time/datasource/urecat/UrecatDatasource.test.ts on lines 52..54

      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 45.

      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

                try {
                  this.duration = EdtfDuration.fromString(timeStr)
                  this.interval = undefined
                  this.date = undefined
                } catch (e) {
      Severity: Minor
      Found in time/TimeContext.ts and 2 other locations - About 30 mins to fix
      time/TimeContext.ts on lines 96..114
      time/TimeContext.ts on lines 101..113

      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 45.

      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

      export function ukDepartment(code: UkDepartementCode, region: Region, place: Place) {
        return Department.create(code, region, place)
      }
      Severity: Minor
      Found in org/uk/region/UkDepartment.ts and 2 other locations - About 30 mins to fix
      org/eu/fr/region/FranceDepartments.ts on lines 41..43
      org/ru/region/RussiaDepartment.ts on lines 6..8

      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 45.

      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

            output.contents = output.contents.replace(`<!--#echo var="countries" -->`,
              HtmlTag.toString("div", countriesHtml, {id: "countries"}))
      Severity: Minor
      Found in people/PeopleDirectoryStep.ts and 1 other location - About 30 mins to fix
      people/PeopleDirectoryStep.ts on lines 75..76

      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 45.

      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 getArgs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        getArgs<T = Record<string, (string | string[])>>(): T {
          const argv = this.argv
          const args: T = {} as T
          for (let i = 2; i < argv.length; i++) {
            const arg = argv[i]
      Severity: Minor
      Found in util/cli/CLI.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 filter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        filter(c: SceauCaseSummary): boolean {
          const dateStr = c.dateCas || c.datePubli || c.dateEnquete
          const isoCaseDate = dateStr.toUpperCase()
          const sightingTime = TimeContext.fromString(isoCaseDate)
          const time = this.context.time
      Severity: Minor
      Found in time/datasource/sceau/SceauDatasource.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 getDate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        protected getDate(context: RR0SsgContext, caseLink: URL, row: Element): RR0SsgContext {
          const timeStr = caseLink.pathname.substring(this.searchPath.length + 2)
          const dateFields = UrecatHttpDatasource.urlDateFormat.exec(timeStr)
          const itemContext = context.clone()
          const dateTime = itemContext.time
      Severity: Minor
      Found in time/datasource/urecat/UrecatHttpDatasource.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 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 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

      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

      Severity
      Category
      Status
      Source
      Language