Showing 559 of 559 total issues

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

const normandyMessageList: { [key in NormandieDepartmentCode]: DepartmentMessages<any> } = {
  [NormandieDepartmentCode.Calvados]: calvadosMessages,
  [NormandieDepartmentCode.SeineMaritime]: seineMaritimeMessages
}
Severity: Minor
Found in org/eu/fr/region/nor/NormandieMessages_en.ts and 1 other location - About 35 mins to fix
org/eu/fr/region/nor/NormandieMessages_fr.ts on lines 7..10

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

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

const normandyMessageList: { [key in NormandieDepartmentCode]: DepartmentMessages<any> } = {
  [NormandieDepartmentCode.Calvados]: calvadosMessages,
  [NormandieDepartmentCode.SeineMaritime]: seineMaritimeMessages
}
Severity: Minor
Found in org/eu/fr/region/nor/NormandieMessages_fr.ts and 1 other location - About 35 mins to fix
org/eu/fr/region/nor/NormandieMessages_en.ts on lines 7..10

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

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

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

    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

    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

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

          outputFile.contents = outputFile.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 260..261

    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

    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

    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

        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 2 locations. Consider refactoring.
    Open

          outputFile.contents = outputFile.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 270..271

    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

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

      protected async createReplacer(context: HtmlRR0SsgContext): Promise<RegexReplacer> {
        return {
          replace: (_match: string, ..._args: any[]): string => {
            const inputFile = context.inputFile
            let title = inputFile.title
    Severity: Minor
    Found in time/SsiTitleReplaceCommand.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 parse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

      parse(context: RR0SsgContext, data: string): S[] {
        let eol = data.indexOf("\n")
        const header = data.substring(0, eol)
        data = data.substring(eol + 1).replaceAll(`""`, "''")
        this.fields.clear()
    Severity: Minor
    Found in time/datasource/CsvMapper.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 getAge has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

      getAge(from?: Date): number | undefined {
        if (this.birthTime) {
          let timeDelta: number;
          if (this.deathTime) {
            timeDelta = this.deathTime.getTime() - this.birthTime.getTime();
    Severity: Minor
    Found in people/People.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 replaceElement has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

      static replaceElement(context: HtmlRR0SsgContext, timeFiles: string[], previousContext?: RR0SsgContext): HTMLElement {
        let replacement: HTMLElement | undefined
        const absoluteTimeStr = TimeUrlBuilder.fromContext(context)
        let title = TimeTextBuilder.build(context)
        let text = previousContext ? RelativeTimeTextBuilder.build(previousContext, context) : undefined
    Severity: Minor
    Found in time/TimeReplacer.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 next has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

      next(context: HtmlRR0SsgContext): Link | undefined {
        let fileName = context.inputFile.name;
        if (this.isTimeFile(fileName)) {
          const pos = this.timeFiles.indexOf(fileName);
          if (pos >= 0) {
    Severity: Minor
    Found in time/TimeLinkDefaultHandler.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

    Severity
    Category
    Status
    Source
    Language