Showing 109 of 313 total issues

Function graphSigmoid has 79 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function graphSigmoid(data) {

    var sigmoid = this.neuralNetworkG.selectAll(this.svgElement + " .sigmoid")
      .data([data])

Severity: Major
Found in people/a/AlammarJay/js/nn_calc.js - About 3 hrs to fix

    Function handleImage has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

      private handleImage(context: HtmlRR0SsgContext, imageUrl: string) {
        const inputFile = context.file.name
        if (imageUrl) {
          const isLocal = !imageUrl.startsWith("http")
          if (isLocal) {
    Severity: Minor
    Found in ImageCommand.ts - About 3 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 graphSoftmaxToOutputArrows has 73 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function graphSoftmaxToOutputArrows(data) {
    
        var inputToBiasLines = this.neuralNetworkG.selectAll(this.svgElement + " .softmax-to-output-line")
          .data(data)
    
    
    Severity: Major
    Found in people/a/AlammarJay/js/nn_calc.js - About 2 hrs to fix

      Function NN_trainer has 69 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var NN_trainer = function (svg_el, table_el, areas, prices, weight, bias, x1, y1, x2, y2,
                                 gradientDescentButton, gradientDescent10Button, gradientDescent100Button,
                                 gradientDescentConvergeButton, normalize, error_chart_el, heatmap_el,
                                 weightRange, biasRange, neuralNetworkGraphEl, analyticsCategory) {
        this.svg_el = svg_el;
      Severity: Major
      Found in people/a/AlammarJay/js/simple_nn.js - About 2 hrs to fix

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

            draw: function (layer, properties, activeRegionSVGGroup) {
              var data = layer.nodeRenderingDetails,
                containerElement = properties.containerElement
              var inputGroups = activeRegionSVGGroup.selectAll(properties.containerElement + " .input-group")
                .data(data)
        Severity: Major
        Found in people/a/AlammarJay/js/nn_calc.js - About 2 hrs to fix

          Function graphInputNodes has 68 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function graphInputNodes(data) {
          
              var grapher = this
              // JOIN
              var inputGroups = this.neuralNetworkG.selectAll(this.svgElement + " .input-group")
          Severity: Major
          Found in people/a/AlammarJay/js/nn_calc.js - About 2 hrs to fix

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

            NN_trainer.prototype.initializeErrorGraph = function () {
              this.error_chart_history_x = 200;       // How many error data points to show
              this.error_chart_history_y = 100000;    // How high the bar goes
              this.error_history = [10000];
            
            
            Severity: Major
            Found in people/a/AlammarJay/js/simple_nn.js - About 2 hrs to fix

              Function NN_trainer has 21 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              var NN_trainer = function (svg_el, table_el, areas, prices, weight, bias, x1, y1, x2, y2,
                                         gradientDescentButton, gradientDescent10Button, gradientDescent100Button,
                                         gradientDescentConvergeButton, normalize, error_chart_el, heatmap_el,
                                         weightRange, biasRange, neuralNetworkGraphEl, analyticsCategory) {
              Severity: Major
              Found in people/a/AlammarJay/js/simple_nn.js - About 2 hrs to fix

                Function gradientDescentStep has a Cognitive Complexity of 19 (exceeds 5 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 2 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 multiVariableNeuralNetworkTrainer has 62 lines of code (exceeds 25 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 2 hrs to fix

                  Function wrapObject has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        const wrapObject = (target, wrappers = {}, metadata = {}) => {
                          let cache = Object.create(null)
                          let handlers = {
                            has (proxyTarget, prop) {
                              return prop in target || prop in cache
                  Severity: Major
                  Found in extension/Shared (Extension)/Resources/browser-polyfill.js - About 2 hrs to fix

                    Function initializeHeatmap has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    NN_trainer.prototype.initializeHeatmap = function () {
                    
                    
                      this.heatmapSideNumberOfElements = 15;
                      //this.heatmapColors = ['#f7fcf0','#e0f3db','#ccebc5','#a8ddb5','#7bccc4','#4eb3d3','#2b8cbe','#0868ac','#084081'].reverse();
                    Severity: Major
                    Found in people/a/AlammarJay/js/simple_nn.js - About 2 hrs to fix

                      Function updateUI has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      NN_trainer.prototype.updateUI = function (mean_delta_sum, errorLineValues) {
                      
                        //Update error chart if available
                        if (this.error_chart_el !== "")
                          this.addErrorPoint(mean_delta_sum);
                      Severity: Major
                      Found in people/a/AlammarJay/js/simple_nn.js - About 2 hrs to fix

                        Function createReplacer has 57 lines of code (exceeds 25 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: Major
                        Found in ImageCommand.ts - About 2 hrs to fix

                          File sw.js has 255 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          const version = '0.1.0'
                          let serverUrl
                          // Cache IDs
                          let coreID = `core_${version}`
                          let pageID = `pages_${version}`
                          Severity: Minor
                          Found in public/sw.js - About 2 hrs to fix

                            Function replace has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                  replace: async (imgEl: HTMLImageElement): Promise<HTMLImageElement> => {
                                    const src = imgEl.src
                                    const imgParentEl = imgEl.parentElement
                                    if (imgParentEl.tagName === "FIGURE") {
                                      const captionEl = imgParentEl.querySelector("figcaption")
                            Severity: Major
                            Found in ImageCommand.ts - About 2 hrs to fix

                              Function initializeTable has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                neuralNetworkCalculationViz.prototype.initializeTable = function (trainingSet) {
                              
                              
                                  var viz = this
                                  var table = d3.select(this.tableElement)
                              Severity: Major
                              Found in people/a/AlammarJay/js/nn_calc.js - About 2 hrs to fix

                                Function portSearchChange has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function portSearchChange (filter) {
                                  tableBody.innerHTML = ""
                                  const input = (portSearchInput.value || "").toLowerCase().trim()
                                
                                  /**
                                Severity: Minor
                                Found in tech/info/soft/net/protocole/index.js - About 2 hrs to fix

                                  Function run has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    async run(context: SsgContext, inputPattern: string): Promise<void> {
                                      const inputFiles = await glob(inputPattern)
                                      const dictionary = new Dictionary(this.logger)
                                      const dictWords = await dictionary.read(this.dictionaryFile)
                                      this.logger.debug("Looking for files", inputPattern)
                                  Severity: Minor
                                  Found in WordFinder.ts - About 2 hrs to fix

                                    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.es5.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language