Showing 109 of 313 total issues

Function compute has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            compute: function (probable) {
                var zerosCount = {};
                var max = 0;
                var questions = self.questions;
                for (var q in questions) {
Severity: Minor
Found in time/1/9/7/7/Poher_Matrice/matrix.js - About 1 hr to fix

    Function initializeErrorGraph has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    multiVariableNeuralNetworkTrainer.prototype.initializeErrorGraph = function () {
    
      this.error_chart_history_x = 300;       // How many error data points to show
      this.error_chart_history_y = 100000;    // How high the bar goes
      this.error_history = [10000];
    Severity: Minor
    Found in people/a/AlammarJay/js/two_variable_nn.js - About 1 hr to fix

      Function addSpeech has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

      export const addSpeech = (e, lang = e.lang, text = getText(e)) => {
        if (!e.classList.contains(transformed)) {
          e.classList.add(transformed)
          const speechEl = document.createElement('button')
          speechEl.className = 'speech'
      Severity: Minor
      Found in lang/speech.js - 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 onMessageWrappers has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            const onMessageWrappers = new DefaultWeakMap(listener => {
              if (typeof listener !== "function") {
                return listener
              }
      
      
      Severity: Minor
      Found in extension/Shared (Extension)/Resources/browser-polyfill.js - About 1 hr to fix

        Function graphLayerInputs has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function graphLayerInputs(layerInputsArray, layerNumber) {
        
        
            var layerInputs = layerInputsArray[layerNumber], layerInputsObjects = []
        
        
        Severity: Minor
        Found in people/a/AlammarJay/js/nn_calc.js - About 1 hr to fix

          Function multiVariableNeuralNetworkTrainer has 15 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          var multiVariableNeuralNetworkTrainer = function (numberOfInputNodes,
                                                            svg_el, table_el,
                                                            dataPoints, labels,
                                                            weights, bias,
                                                            gradientDescentButton, gradientDescent10Button, gradientDescent100Button,
          Severity: Major
          Found in people/a/AlammarJay/js/two_variable_nn.js - About 1 hr to fix

            Function addSpeech has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const addSpeech = (e, lang = e.lang, text = getText(e)) => {
              if (!e.classList.contains(transformed)) {
                e.classList.add(transformed)
                const speechEl = document.createElement('button')
                speechEl.className = 'speech'
            Severity: Minor
            Found in lang/speech.js - About 1 hr to fix

              Function drawGraph has a Cognitive Complexity of 14 (exceeds 5 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: Minor
              Found in people/a/AlammarJay/js/shallow_nn_grapher.js - 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 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 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 onMessage has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          return function onMessage (message, sender, sendResponse) {
                            let didCallSendResponse = false
                            let wrappedSendResponse
                            let sendResponsePromise = new Promise(resolve => {
                              wrappedSendResponse = function (response) {
                  Severity: Minor
                  Found in extension/Shared (Extension)/Resources/browser-polyfill.js - About 1 hr to fix

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

                      protected getFromRow(context: RR0SsgContext, row: Element): GeipanCaseSummary {
                        const linkField = row.querySelector(".fiche-download-icon")
                        const caseLink = linkField.firstElementChild as HTMLAnchorElement
                        const url = new URL(caseLink.href, this.baseUrl)
                        const caseField = row.querySelector(".cas_title")
                    Severity: Minor
                    Found in org/eu/fr/cnes/geipan/GeipanHttpDatasource.ts - About 1 hr to fix

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

                                  window.findPeople = (_e) => {
                                    const value = normalize(textInput.value)
                                    const list = document.querySelector("#searchForm + ul")
                                    let found = 0
                                    const selectedCountries = countryInputs.filter(countryInput => countryInput.checked)
                                Severity: Minor
                                Found in people/index.js - 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 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 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
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language