Showing 109 of 313 total issues

Function f has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  d3.f = function () {
    var functions = arguments
    //convert all string arguments into field accessors
    var i = 0, l = functions.length
    while (i < l) {

    Function f has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      d3.f = function () {
        var functions = arguments
        //convert all string arguments into field accessors
        var i = 0, l = functions.length
        while (i < l) {
    Severity: Minor
    Found in people/a/AlammarJay/js/d3-jetpack.js - About 1 hr to fix

      Function sigmoidGraph has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      var sigmoidGraph = function (containerElement, xStart, xEnd, xDefault, sliderElement, sigmoidInputElement,
                                   sigmoidFormulaInputElement, sigmoidResult, sigmoidGraphResult) {
      Severity: Major
      Found in people/a/AlammarJay/js/sigmoid_graph.js - About 1 hr to fix

        Function reluGraph has 9 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        var reluGraph = function (containerElement, xStart, xEnd, xDefault, sliderElement, reluInputElement,
                                  reluFormulaInputElement, reluResult, reluGraphResult) {
        Severity: Major
        Found in people/a/AlammarJay/js/relu_graph.js - About 1 hr to fix

          Function removeIndent has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

            protected removeIndent(lines: string[]) {
              let minIndent = Number.MAX_VALUE;
              for (const line of lines) {
                if (line.length > 0) {
                  let i = 0;
          Severity: Minor
          Found in tech/info/soft/proj/impl/lang/CodeReplacer.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 createReplacer has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

            protected async createReplacer(context: HtmlRR0SsgContext): Promise<RegexReplacer> {
              return {
                replace: (_match: string, ..._args: any[]): string => {
                  const file = context.file
                  let authors = file.meta.author
          Severity: Minor
          Found in people/author/AuthorReplaceCommand.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 execute has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            async execute(context: HtmlRR0SsgContext): Promise<void> {
              const file = context.file
              const inDescription = file.meta.description
              const outDoc = file.document
              let descriptionMeta = outDoc.head.querySelector("meta[name='description']")
          Severity: Minor
          Found in DescriptionReplaceCommand.ts - About 1 hr to fix

            Function process has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              protected async process(context: HtmlRR0SsgContext, data: RR0Data) {
                this.processTitle(context, data)
                this.processURL(context, data)
                const events = data.events.sort(
                  (event1, event2) => event1.time ? event2.time ? event1.time.isBefore(event2.time) ? -1 : 1 : -1 : 1)
            Severity: Minor
            Found in DefaultContentVisitor.ts - About 1 hr to fix

              Function read has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                async read(): Promise<T[]> {
                  if (this.values.length > 0) {
                    this.logger.warn("Overwriting previously read values", this.values)
                  }
                  this.values = []
              Severity: Minor
              Found in CSVFileReader.ts - About 1 hr to fix

                Function getWeightNodeCoordinates has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

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

                  Consider simplifying this complex logical expression.
                  Open

                    if (!(globalThis.browser && globalThis.browser.runtime && globalThis.browser.runtime.id)) {
                      const CHROME_SEND_MESSAGE_CALLBACK_NO_RESPONSE_MESSAGE = "The message port closed before a response was received."
                  
                      // Wrapping the bulk of this polyfill in a one-time-use function is a minor
                      // optimization for Firefox. Since Spidermonkey does not fully parse the
                  Severity: Major
                  Found in extension/Shared (Extension)/Resources/browser-polyfill.js - About 1 hr to fix

                    Function gradientDescentStep has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                    NN_trainer.prototype.gradientDescentStep = function (number_of_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.learningRate = 0.00000001;
                    Severity: Minor
                    Found in people/a/AlammarJay/js/simple_nn.js - About 55 mins 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 getSoftmaxtoOutputLinesData has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      function getSoftmaxtoOutputLinesData(outputNodeCount, activationLayerX, nodeRadius, outputLayerCoordinates,
                                                           outputLayerX, classes) {
                    Severity: Minor
                    Found in people/a/AlammarJay/js/nn_calc.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                  for (let i = 0; i < dictWord.length; i++, matchStart++) {
                                    const dictWordChar = dictWord.charAt(i)
                                    const fileWordChar = contents.charAt(pos + matchStart)
                                    if (fileWordChar === badChar) {
                                      score += 5
                      Severity: Major
                      Found in WordFinder.ts - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                      if (choice.value !== false) {
                                        var knownPhenomenaProbabilities = choice.knownPhenomenaProbabilities
                                        for (var p in knownPhenomenaProbabilities) {
                                          if (knownPhenomenaProbabilities.hasOwnProperty(p)) {
                                            if (!zerosCount[p]) {
                        Severity: Major
                        Found in time/1/9/7/7/Poher_Matrice/matrix.es5.js - About 45 mins to fix

                          Function fileSearchChange has a Cognitive Complexity of 8 (exceeds 5 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 45 mins 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

                          Avoid deeply nested control flow statements.
                          Open

                                                          if (choice.value !== false) {
                                                              var knownPhenomenaProbabilities = choice.knownPhenomenaProbabilities;
                                                              for (var p in knownPhenomenaProbabilities) {
                                                                  if (knownPhenomenaProbabilities.hasOwnProperty(p)) {
                                                                      if (!zerosCount[p]) {
                          Severity: Major
                          Found in time/1/9/7/7/Poher_Matrice/matrix.js - About 45 mins to fix

                            Function getLayerXScale has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                              function getLayerXScale(numberOfLayers, layersRegionWidth, outputRegionWidth, marginLeft, nodeRadius) {
                            Severity: Minor
                            Found in people/a/AlammarJay/js/nn_calc.js - About 35 mins to fix

                              Function draw has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  draw: function (layer, properties, activeRegionSVGGroup, layerInputs, tooltipDiv) {
                              Severity: Minor
                              Found in people/a/AlammarJay/js/nn_calc.js - About 35 mins to fix

                                Function NN_trainer has a Cognitive Complexity of 7 (exceeds 5 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: Minor
                                Found in people/a/AlammarJay/js/simple_nn.js - About 35 mins 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

                                Severity
                                Category
                                Status
                                Source
                                Language