people/a/AlammarJay/js/relu_graph.js

Summary

Maintainability
F
6 days
Test Coverage

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 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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      reluGraph.prototype.updateGraph = function () {
      
        var obj = this
        this.width = this.graphWidth - this.margin.left - this.margin.right
        this.height = this.graphHeight - this.margin.top - this.margin.bottom
      Severity: Major
      Found in people/a/AlammarJay/js/relu_graph.js and 1 other location - About 2 days to fix
      people/a/AlammarJay/js/sigmoid_graph.js on lines 145..178

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 382.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      var reluGraph = function (containerElement, xStart, xEnd, xDefault, sliderElement, reluInputElement,
                                reluFormulaInputElement, reluResult, reluGraphResult) {
        this.containerElement = containerElement
        this.graphWidth = 400
        this.graphHeight = 160
      Severity: Major
      Found in people/a/AlammarJay/js/relu_graph.js and 1 other location - About 7 hrs to fix
      people/a/AlammarJay/js/sigmoid_graph.js on lines 5..23

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 187.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      reluGraph.prototype.attachEventsToSlider = function () {
        console.log("attach", this.sliderElement)
        // Attach events to react to the user moving the sliders
        var self = this
        $(this.sliderElement).on("input change", (function () {
      Severity: Major
      Found in people/a/AlammarJay/js/relu_graph.js and 1 other location - About 6 hrs to fix
      people/a/AlammarJay/js/sigmoid_graph.js on lines 181..192

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 165.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        this.valueG = this.g.append("g")
          .attr("class", "value-point")
          .attr("transform", "translate(" + this.x(this.xDefault) + "," + this.y(relu(this.xDefault)) + ")")
      Severity: Major
      Found in people/a/AlammarJay/js/relu_graph.js and 1 other location - About 2 hrs to fix
      people/a/AlammarJay/js/sigmoid_graph.js on lines 121..123

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 85.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

        this.g.append("g")
          .attr("transform", "translate(0," + this.height + ")")
          .attr("class", "x-axis")
          .call(d3.axisBottom(obj.x))
          .select(".domain")
      Severity: Major
      Found in people/a/AlammarJay/js/relu_graph.js and 1 other location - About 2 hrs to fix
      people/a/AlammarJay/js/sigmoid_graph.js on lines 63..68

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 84.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

        this.g.append("g")
          .attr("class", "grid")
          .attr("transform", "translate(0," + this.height + ")")
          .call(make_x_gridlines()
            .tickSize(-this.height)
      Severity: Major
      Found in people/a/AlammarJay/js/relu_graph.js and 1 other location - About 2 hrs to fix
      people/a/AlammarJay/js/sigmoid_graph.js on lines 91..97

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 82.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        this.valueG.append("text")
          .attr("class", "relu-value-text activation-value-text")
          .attr("fill", "red")
          .attr("text-anchor", "middle")
          .attr("font-size", "12")
      Severity: Major
      Found in people/a/AlammarJay/js/relu_graph.js and 1 other location - About 2 hrs to fix
      people/a/AlammarJay/js/sigmoid_graph.js on lines 133..139

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 78.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        d3.select(this.containerElement + " .value-point")
          .attr("transform", "translate(" + this.x(inputValue) + "," + this.y(relu(inputValue)) + ")")
      Severity: Major
      Found in people/a/AlammarJay/js/relu_graph.js and 1 other location - About 1 hr to fix
      people/a/AlammarJay/js/sigmoid_graph.js on lines 210..211

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 68.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

        this.g = this.graphHolder.append("g")
          .attr("transform", "translate(" + this.margin.left + "," + this.margin.top + ")")
      Severity: Major
      Found in people/a/AlammarJay/js/relu_graph.js and 1 other location - About 1 hr to fix
      people/a/AlammarJay/js/sigmoid_graph.js on lines 36..37

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 64.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

        this.g.append("g")
          .attr("class", "grid")
          .call(make_y_gridlines()
            .tickSize(-this.width)
            .tickFormat("")
      Severity: Major
      Found in people/a/AlammarJay/js/relu_graph.js and 1 other location - About 1 hr to fix
      people/a/AlammarJay/js/sigmoid_graph.js on lines 106..111

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 61.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        this.valueG.append("ellipse")
          .attr("class", "relu-value-dot activation-value-dot")
          .attr("rx", 5)
          .attr("ry", 5)
          .attr("cx", 0)
      Severity: Major
      Found in people/a/AlammarJay/js/relu_graph.js and 1 other location - About 1 hr to fix
      people/a/AlammarJay/js/sigmoid_graph.js on lines 125..130

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 60.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 15 locations. Consider refactoring.
      Open

        this.height = +this.graphHolder.attr("height") - this.margin.top - this.margin.bottom
      Severity: Major
      Found in people/a/AlammarJay/js/relu_graph.js and 14 other locations - About 40 mins to fix
      people/a/AlammarJay/js/accuracy-graph.js on lines 19..19
      people/a/AlammarJay/js/accuracy-graph.js on lines 20..20
      people/a/AlammarJay/js/relu_graph.js on lines 34..34
      people/a/AlammarJay/js/shallow_nn_grapher.js on lines 31..31
      people/a/AlammarJay/js/shallow_nn_grapher.js on lines 32..32
      people/a/AlammarJay/js/sigmoid_graph.js on lines 34..34
      people/a/AlammarJay/js/sigmoid_graph.js on lines 35..35
      people/a/AlammarJay/js/simple_nn.js on lines 196..197
      people/a/AlammarJay/js/simple_nn.js on lines 542..542
      people/a/AlammarJay/js/simple_nn.js on lines 543..543
      people/a/AlammarJay/js/two_variable_nn.js on lines 109..109
      people/a/AlammarJay/js/two_variable_nn.js on lines 110..110
      people/a/AlammarJay/js/two_variable_nn.js on lines 278..278
      people/a/AlammarJay/js/two_variable_nn.js on lines 279..279

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 49.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 15 locations. Consider refactoring.
      Open

        this.width = +this.graphHolder.attr("width") - this.margin.left - this.margin.right
      Severity: Major
      Found in people/a/AlammarJay/js/relu_graph.js and 14 other locations - About 40 mins to fix
      people/a/AlammarJay/js/accuracy-graph.js on lines 19..19
      people/a/AlammarJay/js/accuracy-graph.js on lines 20..20
      people/a/AlammarJay/js/relu_graph.js on lines 35..35
      people/a/AlammarJay/js/shallow_nn_grapher.js on lines 31..31
      people/a/AlammarJay/js/shallow_nn_grapher.js on lines 32..32
      people/a/AlammarJay/js/sigmoid_graph.js on lines 34..34
      people/a/AlammarJay/js/sigmoid_graph.js on lines 35..35
      people/a/AlammarJay/js/simple_nn.js on lines 196..197
      people/a/AlammarJay/js/simple_nn.js on lines 542..542
      people/a/AlammarJay/js/simple_nn.js on lines 543..543
      people/a/AlammarJay/js/two_variable_nn.js on lines 109..109
      people/a/AlammarJay/js/two_variable_nn.js on lines 110..110
      people/a/AlammarJay/js/two_variable_nn.js on lines 278..278
      people/a/AlammarJay/js/two_variable_nn.js on lines 279..279

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 49.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        this.g.append("path")
          .datum(this.values)
          .attr("class", "relu-line activation-line-straight")
          .attr("d", line)
      Severity: Minor
      Found in people/a/AlammarJay/js/relu_graph.js and 1 other location - About 35 mins to fix
      people/a/AlammarJay/js/sigmoid_graph.js on lines 115..118

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 47.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      There are no issues that match your filters.

      Category
      Status