Showing 563 of 563 total issues

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

  this.g = this.graphHolder.append("g")
    .attr("transform", "translate(" + this.margin.left + "," + this.margin.top + ")")
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 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 64.

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 drawGraphOld has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  neuralNetworkCalculationViz.prototype.drawGraphOld = function () {

    var grapher = this
    // Let's calculate our coordinates for all the nodes
    // Let's start with the X coordiantes for each layer
Severity: Minor
Found in people/a/AlammarJay/js/nn_calc.js - About 1 hr to fix

    Function createFromData has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      createFromData(context: RR0SsgContext, dirName: string, data: People): People {
        const people = this.createFromDirName(dirName)
        const title = (data as any).title
        if (title) {
          const names = title.split(",")
    Severity: Minor
    Found in people/PeopleService.ts - About 1 hr to fix

      Function setTimeContextFrom has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

        static setTimeContextFrom(timeContext: TimeContext, parsed: TimeParseResult) {
          if (parsed.yearStr) {
            const year = parseInt(parsed.yearStr, 10)
            if (!Number.isNaN(year)) {
              timeContext.setYear(year)
      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 activate has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var activate = function (d) {
            console.log("INSIDE", viz.layerValues[1])
            if (viz.layerValues[1]) {
              // Set up the tooltip to show the inputs and their sum
              var rows = "<table class=\"softmax-calculation\">", total = 0,
      Severity: Minor
      Found in people/a/AlammarJay/js/nn_calc.js - About 1 hr to fix

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

          static createMilitary(dirs: string[], excludedDirs: string[],
                                outputFunc: OutputFunc, config: SsgConfig, service: PeopleService) {
            return new PeopleDirectoryStep(dirs, excludedDirs, "people/militaires.html", outputFunc, config,
              [Occupation.military], service, "military people directories")
          }
        Severity: Major
        Found in people/PeopleDirectoryStep.ts and 3 other locations - About 1 hr to fix
        people/PeopleDirectoryStep.ts on lines 99..103
        people/PeopleDirectoryStep.ts on lines 105..109
        people/PeopleDirectoryStep.ts on lines 117..121

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

        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.table_el + "-weightSlider").on("mouseup touchend", (function () {
            ga('send', 'event', trainer_self.analyticsCategory, "Interacted with", "Weight slider");
            _paq.push(['trackEvent', trainer_self.analyticsCategory, "Interacted with", "Weight slider"]);
          }));
        Severity: Major
        Found in people/a/AlammarJay/js/simple_nn.js and 1 other location - About 1 hr to fix
        people/a/AlammarJay/js/simple_nn.js on lines 76..79

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

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

          static createAstronomers(dirs: string[], excludedDirs: string[], outputFunc: OutputFunc, config: SsgConfig,
                                   service: PeopleService) {
            return new PeopleDirectoryStep(dirs, excludedDirs, "people/astronomes.html", outputFunc, config,
              [Occupation.astronomer], service, "astronomers directories")
          }
        Severity: Major
        Found in people/PeopleDirectoryStep.ts and 3 other locations - About 1 hr to fix
        people/PeopleDirectoryStep.ts on lines 77..81
        people/PeopleDirectoryStep.ts on lines 99..103
        people/PeopleDirectoryStep.ts on lines 117..121

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

        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

            var inputLayerCoordinates = d3.range(inputNodeCount).map(function (i) {
              var y = getYCoordinateOfNodeInInputLayer(i)
              return { x: inputLayerX, y: y, index: i, type: 'input' }
            })
        Severity: Major
        Found in people/a/AlammarJay/js/nn_calc.js and 1 other location - About 1 hr to fix
        people/a/AlammarJay/js/nn_calc.js on lines 1556..1559

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

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

          static createContactees(dirs: string[], excludedDirs: string[], outputFunc: OutputFunc, config: SsgConfig,
                                  service: PeopleService) {
            return new PeopleDirectoryStep(dirs, excludedDirs, "people/contactes.html", outputFunc, config,
              [Occupation.contactee], service, "contactees directories")
          }
        Severity: Major
        Found in people/PeopleDirectoryStep.ts and 3 other locations - About 1 hr to fix
        people/PeopleDirectoryStep.ts on lines 77..81
        people/PeopleDirectoryStep.ts on lines 105..109
        people/PeopleDirectoryStep.ts on lines 117..121

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

        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

            var nodeLayerCoordinates = d3.range(nodeCount).map(function (i) {
              var y = getYCoordinateOfNodeLayer(i)
              return { x: layerXCoordinate, y: y, index: i, type: 'input' }
            })
        Severity: Major
        Found in people/a/AlammarJay/js/nn_calc.js and 1 other location - About 1 hr to fix
        people/a/AlammarJay/js/nn_calc.js on lines 1318..1321

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

        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.table_el + "-biasSlider").on("mouseup touchend", (function () {
            ga('send', 'event', trainer_self.analyticsCategory, "Interacted with", "Bias slider");
            _paq.push(['trackEvent', trainer_self.analyticsCategory, "Interacted with", "Bias slider"]);
          }));
        Severity: Major
        Found in people/a/AlammarJay/js/simple_nn.js and 1 other location - About 1 hr to fix
        people/a/AlammarJay/js/simple_nn.js on lines 71..74

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

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

          static createUfologists(dirs: string[], excludedDirs: string[], outputFunc: OutputFunc, config: SsgConfig,
                                  service: PeopleService) {
            return new PeopleDirectoryStep(dirs, excludedDirs, "people/ufologues.html", outputFunc, config,
              [Occupation.ufologist], service, "ufologists directories")
          }
        Severity: Major
        Found in people/PeopleDirectoryStep.ts and 3 other locations - About 1 hr to fix
        people/PeopleDirectoryStep.ts on lines 77..81
        people/PeopleDirectoryStep.ts on lines 99..103
        people/PeopleDirectoryStep.ts on lines 105..109

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

        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 graphInputNodes has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        shallowNeuralNetworkGrapher.prototype.graphInputNodes = function (data) {
          // JOIN
          var inputGroups = this.neuralNetworkG.selectAll(this.svgElement + " .input-group").data(data);
        
          // EXIT old elements not present in new data.
        Severity: Minor
        Found in people/a/AlammarJay/js/shallow_nn_grapher.js - About 1 hr to fix

          Function getWitnesses has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            getWitnesses(witnessesStr: string): UrecatWitness[] {
              let lastName = ""
              const andNames = witnessesStr
                .split(" et ")
                .flatMap(and => and.split(","))
          Severity: Minor
          Found in time/datasource/urecat/UrecatHttpDatasource.ts - About 1 hr to fix

            Function fileSearchChange has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function fileSearchChange (e) {
              tableBody.innerHTML = ""
              const input = (fileSearchInput.value || "").toLowerCase().trim()
            
              /**
            Severity: Minor
            Found in tech/info/soft/data/doc/index.js - About 1 hr to fix

              Function graphOutputNodes has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              shallowNeuralNetworkGrapher.prototype.graphOutputNodes = function (data) {
                // JOIN
                var inputGroups = this.neuralNetworkG.selectAll(this.svgElement + " .output-group")
                  .data(data);
              
              
              Severity: Minor
              Found in people/a/AlammarJay/js/shallow_nn_grapher.js - About 1 hr to fix

                Function getLink has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  getLink(context: HtmlRR0SsgContext, aCase: RR0Case): HTMLElement {
                    const details: string[] = []
                    const classList = ["data-resolved"]
                    const classification = aCase.classification
                    const hynek = classification?.hynek
                Severity: Minor
                Found in science/crypto/ufo/enquete/dossier/CaseService.ts - About 1 hr to fix

                  Function durationReplacement has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    protected durationReplacement(
                      context: HtmlRR0SsgContext, daysStr: string, hoursStr: string, minutesStr: string, secondsStr: string
                    ): HTMLTimeElement | undefined {
                      const items = []
                      const messages = context.messages.context.time.duration
                  Severity: Minor
                  Found in time/TimeReplacer.ts - About 1 hr to fix

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

                    export const canada_en = CountryMessages.create<CanadaMessages>("Canada",
                      {
                        [CanadaRegionCode.ab]: albertaMessages_en,
                        [CanadaRegionCode.bc]: britishColumbiaMessages_en,
                        [CanadaRegionCode.qc]: quebecMessages_en,
                    Severity: Major
                    Found in org/ca/Canada_en.ts and 7 other locations - About 1 hr to fix
                    org/eu/fr/region/cvl/CentreValDeLoireMessages.ts on lines 10..16
                    org/eu/fr/region/ges/57/MoselleMessages.ts on lines 10..15
                    org/eu/fr/region/hdf/59/NordMessages.ts on lines 10..15
                    org/eu/fr/region/hdf/HautsDeFranceMessages.ts on lines 10..15
                    org/eu/fr/region/naq/16/CharenteMessages.ts on lines 10..15
                    org/eu/fr/region/naq/17/CharenteMaritimeMessages.ts on lines 10..15
                    org/eu/fr/region/pdl/PaysDeLoireMessages.ts on lines 10..15

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

                    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