Showing 163 of 559 total issues

File nn_calc.js has 1464 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function (global, factory) {
  typeof exports === "object" && typeof module !== "undefined" ? factory() :
    typeof define === "function" && define.amd ? define(factory) :
      (factory())
}(this, (function () {
Severity: Major
Found in people/a/AlammarJay/js/nn_calc.js - About 3 days to fix

    peopleMessages_fr has 82 functions (exceeds 20 allowed). Consider refactoring.
    Open

      occupation: {
        actor: (gender: Gender) => gender === Gender.male ? "acteur" : "actrice",
        anthropologist: (_gender: Gender) => "anthropologue",
        archeologist: (_gender: Gender) => "archéologue",
        artist: (_gender: Gender) => "artiste",
    Severity: Major
    Found in people/PeopleMessages_fr.ts - About 1 day to fix

      peopleMessages_en has 82 functions (exceeds 20 allowed). Consider refactoring.
      Open

        occupation: {
          actor: (gender: Gender) => gender === Gender.male ? "actor" : "actress",
          anthropologist: (_gender: Gender) => "anthropologist",
          archeologist: (_gender: Gender) => "archeologist",
          artist: (_gender: Gender) => "artist",
      Severity: Major
      Found in people/PeopleMessages_en.ts - About 1 day to fix

        Function build has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring.
        Open

          static build(oldContext: RR0SsgContext, newContext: RR0SsgContext): string {
            const previousTime = oldContext?.time;
            if (!previousTime?.isDefined()) {
              return TimeTextBuilder.build(newContext)
            }
        Severity: Minor
        Found in time/RelativeTimeTextBuilder.ts - About 1 day 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

        File simple_nn.js has 583 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /**
         * Created by alammar on 11/16/16.
         */
        
        
        
        Severity: Major
        Found in people/a/AlammarJay/js/simple_nn.js - About 1 day to fix

          File shallow_nn_grapher.js has 442 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /**
           * Created by alammar on 12/8/16.
           */
          
          var shallowNeuralNetworkGrapher = function (inputNodeCount, outputNodeCount, svgElement, analyticsCategory) {
          Severity: Minor
          Found in people/a/AlammarJay/js/shallow_nn_grapher.js - About 6 hrs to fix

            Function createReplacer has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
            Open

              protected async createReplacer(context: HtmlRR0SsgContext): Promise<DomReplacer> {
                const doc = context.outputFile.document
                return new class implements DomReplacer {
                  async replace(original: HTMLElement): Promise<HTMLElement> {
                    if (!original.hasChildNodes()) {
            Severity: Minor
            Found in lang/LanguageReplaceCommand.ts - About 6 hrs 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 build has 153 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              static build(oldContext: RR0SsgContext, newContext: RR0SsgContext): string {
                const previousTime = oldContext?.time;
                if (!previousTime?.isDefined()) {
                  return TimeTextBuilder.build(newContext)
                }
            Severity: Major
            Found in time/RelativeTimeTextBuilder.ts - About 6 hrs to fix

              File two_variable_nn.js has 398 lines of code (exceeds 250 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 5 hrs to fix

                Function handleInternal has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                Open

                  protected async handleInternal(context: HtmlRR0SsgContext, a: HTMLAnchorElement, url: URL) {
                    if (url.protocol.startsWith("http")) {
                      const pathname = url.pathname
                      const pathToSearch = pathname.substring(1)
                      if (pathToSearch && this.caseService.dirs.find(dir => dir.startsWith(pathToSearch))) {
                Severity: Minor
                Found in anchor/AnchorReplacer.ts - About 5 hrs 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 initializeNeuralNetworkGraph has 121 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                multiVariableNeuralNetworkTrainer.prototype.initializeNeuralNetworkGraph = function () {
                  this.nnGraphHolder = d3.select(this.neuralNetworkGraphEl) // select the 'body' element
                    .append("svg")           // append an SVG element to the body
                    .attr("width", this.graphWidth)      // make the SVG element 449 pixels wide
                    .attr("height", 250);    // make the SVG element 249 pixels high
                Severity: Major
                Found in people/a/AlammarJay/js/two_variable_nn.js - About 4 hrs to fix

                  Function initializeGraph has 113 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  accuracyGraph.prototype.initializeGraph = function (containerElement, data) {
                  
                    this.graphHolder = d3.select(this.containerElement) // select the 'body' element
                      .append("svg")
                      .attr("class", "accuracy-graph")
                  Severity: Major
                  Found in people/a/AlammarJay/js/accuracy-graph.js - About 4 hrs to fix

                    Function getPeopleLink has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                    Open

                      static getPeopleLink(context: HtmlRR0SsgContext,
                                           people: KnownPeople, pseudoPeopleList: People[], allCountries: Set<CountryCode>,
                                           occupations: Set<Occupation>, filterOccupations: Occupation[], content?: string): HTMLElement {
                        const dirName = people.dirName
                        const titles = []
                    Severity: Minor
                    Found in people/PeopleDirectoryStep.ts - About 4 hrs 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 import has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                    Open

                      async import(fileName: string) {
                        const COLUMN_YEAR_PUBLISHED = "Year Published"
                        const COLUMN_TITLE = "Title"
                        const COLUMN_PUBLISHER = "Publisher"
                        const COLUMN_AUTHOR = "Author"
                    Severity: Minor
                    Found in book/BookService.ts - About 4 hrs 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 28 (exceeds 5 allowed). Consider refactoring.
                    Open

                      protected async createReplacer(context: HtmlRR0SsgContext): Promise<DomReplacer<HTMLImageElement>> {
                        return {
                          replace: async (imgEl: HTMLImageElement): Promise<HTMLImageElement> => {
                            const src = imgEl.src;
                            const imgParentEl = imgEl.parentElement;
                    Severity: Minor
                    Found in ImageCommand.ts - About 4 hrs 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 drawGraph has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    shallowNeuralNetworkGrapher.prototype.drawGraph = function () {
                      var grapher = this;
                      this.nodeRadius = 15;
                      this.weightNodeWidthRatio = 1.7;
                      // Let's calculate our coordinates for all the nodes
                    Severity: Major
                    Found in people/a/AlammarJay/js/shallow_nn_grapher.js - About 3 hrs to fix

                      Function draw has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          draw: function (layer, properties, activeRegionSVGGroup, layerInputs, tooltipDiv) {
                            console.log("layer", layer)
                            var data = layer.nodeRenderingDetails,
                              containerElement = properties.containerElement
                      
                      
                      Severity: Major
                      Found in people/a/AlammarJay/js/nn_calc.js - About 3 hrs to fix

                        Function initializeGraph has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        reluGraph.prototype.initializeGraph = function () {
                          var obj = this
                          this.graphHolder = d3.select(this.containerElement) // select the 'body' element
                            .append("svg")           // append an SVG element to the body
                            .attr("class", "activation-graph")
                        Severity: Major
                        Found in people/a/AlammarJay/js/relu_graph.js - About 3 hrs to fix

                          Function initializeGraph has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          sigmoidGraph.prototype.initializeGraph = function () {
                            var obj = this;
                            this.graphHolder = d3.select(this.containerElement) // select the container element
                              .append("svg")           // append an SVG element to the body
                              .attr("class", "activation-graph")
                          Severity: Major
                          Found in people/a/AlammarJay/js/sigmoid_graph.js - About 3 hrs to fix

                            Function getPeopleLink has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              static getPeopleLink(context: HtmlRR0SsgContext,
                                                   people: KnownPeople, pseudoPeopleList: People[], allCountries: Set<CountryCode>,
                                                   occupations: Set<Occupation>, filterOccupations: Occupation[], content?: string): HTMLElement {
                                const dirName = people.dirName
                                const titles = []
                            Severity: Major
                            Found in people/PeopleDirectoryStep.ts - About 3 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language