Showing 166 of 560 total issues

Function neuralNetworkCalculationViz has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  var neuralNetworkCalculationViz = function (inputs, inputNodeCount, outputNodeCount, activation, containerElement, weights, biases, tableElement,
                                              trainingSet, classes) {


    this.properties = {
Severity: Minor
Found in people/a/AlammarJay/js/nn_calc.js - About 1 hr to fix

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

    NN_trainer.prototype.initializeGraph = function () {
      this.holder = d3.select(this.svg_el) // 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", 249);    // make the SVG element 249 pixels high
    Severity: Minor
    Found in people/a/AlammarJay/js/simple_nn.js - About 1 hr to fix

      Function graphInputToBiasLines has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function graphInputToBiasLines(data) {
      
          var inputToBiasLines = this.neuralNetworkG.selectAll(this.svgElement + " .input-to-bias-line")
            .data(data)
      
      
      Severity: Minor
      Found in people/a/AlammarJay/js/nn_calc.js - About 1 hr to fix

        Function graphWeightNodes has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        shallowNeuralNetworkGrapher.prototype.graphWeightNodes = function (data) {
          var radius = this.nodeRadius * 0.6;
          var t = d3.transition()
            .duration(750);
        
        
        Severity: Minor
        Found in people/a/AlammarJay/js/shallow_nn_grapher.js - About 1 hr to fix

          Function fromInternalLink has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            protected async fromInternalLink(href: string, context: HtmlRR0SsgContext): Promise<Source> {
              if (path.dirname(href).startsWith("/")) {
                href = href.substring(1)
              }
              const hashPos = href.lastIndexOf("#")
          Severity: Minor
          Found in source/SourceReplacerFactory.ts - About 1 hr to fix

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

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

              Function activate has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

                Function execute has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    execute(matchCriteria, firstIndex, maxCount, format = true, allowEmpty = true) {
                        return __awaiter(this, void 0, void 0, function* () {
                            this.logger.logVerbose(`Querying...`)
                            const processingStart = Date.now()
                            const recordEnumerator = this.input.recordEnumerator(firstIndex, maxCount)
                Severity: Minor
                Found in udb/Query.js - About 1 hr to fix

                  Function getWeightNodeCoordinates has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function getWeightNodeCoordinates(inputLayerNodeCount,
                                                      inputNodeCount, outputNodeCount,
                                                      inputLayerCoordinates, weightLayerXCoordinates,
                                                      outputLayerCoordinates,
                                                      biasLayerX, inputLayerX) {
                  Severity: Minor
                  Found in people/a/AlammarJay/js/nn_calc.js - About 1 hr to fix

                    Function createFromData has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                      createFromData(context: RR0SsgContext, dirName: string, data: People): People {
                        const people = this.createFromDirName(dirName)
                        const title = data.title
                        if (title) {
                          try {
                    Severity: Minor
                    Found in people/PeopleService.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 getInfoStr has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                      getInfoStr(context: HtmlRR0SsgContext) {
                        const authors = context.inputFile.meta.author
                        const authorsStr = authors && authors.length > 0 ? authors.join(" & ") : ""
                    
                        let timeStr = ""
                    Severity: Minor
                    Found in OpenGraphCommand.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 getWitnesses has a Cognitive Complexity of 13 (exceeds 5 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

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

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

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

                      async update(parent?: Chapter) {
                        const file = this.context.outputFile;
                        const meta = file.meta;
                        const links = file.links;
                        if (parent) {
                    Severity: Minor
                    Found in book/Chapters.ts - About 1 hr to fix

                      Function graphBiasToSoftmaxArrows has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      shallowNeuralNetworkGrapher.prototype.graphBiasToSoftmaxArrows = function (data) {
                        var inputToBiasLines = this.neuralNetworkG.selectAll(this.svgElement + " .bias-to-softmax-line")
                          .data(data);
                      
                        inputToBiasLines.exit()
                      Severity: Minor
                      Found in people/a/AlammarJay/js/shallow_nn_grapher.js - About 1 hr to fix

                        Function graphBiasToSoftmaxArrows has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          function graphBiasToSoftmaxArrows(data) {
                        
                            var inputToBiasLines = this.neuralNetworkG.selectAll(this.svgElement + " .bias-to-softmax-line")
                              .data(data)
                        
                        
                        Severity: Minor
                        Found in people/a/AlammarJay/js/nn_calc.js - About 1 hr to fix

                          Function graphSoftmaxOutputs has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            function graphSoftmaxOutputs(softmaxOutputs) {
                              var grapher = this
                              var data = []
                              for (var i = 0; i < this.softmaxOutputs.length; i++) {
                                data.push({
                          Severity: Minor
                          Found in people/a/AlammarJay/js/nn_calc.js - About 1 hr to fix

                            Function createFromData has 37 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.title
                                if (title) {
                                  try {
                            Severity: Minor
                            Found in people/PeopleService.ts - About 1 hr to fix

                              Function parse has 37 lines of code (exceeds 25 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 1 hr to fix

                                Function graphInputToBiasLines has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                shallowNeuralNetworkGrapher.prototype.graphInputToBiasLines = function (data) {
                                  var inputToBiasLines = this.neuralNetworkG.selectAll(this.svgElement + " .input-to-bias-line")
                                    .data(data);
                                
                                  inputToBiasLines.exit()
                                Severity: Minor
                                Found in people/a/AlammarJay/js/shallow_nn_grapher.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language