JeffDeCola/control-fpga-via-raspi-and-webserver

View on GitHub

Showing 219 of 219 total issues

File opcode.js has 1413 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* opcode.js */

console.log("STARTING opcode.js JAVASCRIPT");

var compute_go_state = "ready";
Severity: Major
Found in section-4-web-server/control-an-fpga/js/opcode.js - About 3 days to fix

    Function main has 184 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func main() {
    
        fmt.Println("Working on browser")
    
        // INIT HOST MACHINE (i.e. Raspberry Pi)
    Severity: Major
    Found in section-3-backend-server/main.go - About 6 hrs to fix

      Method data_pins.write_data_in has a Cognitive Complexity of 48 (exceeds 20 allowed). Consider refactoring.
      Open

      func (d data_pins) write_data_in(d7 int, d6 int, d5 int, d4 int, d3 int, d2 int, d1 int, d0 int) {
      
          if d7 == 1 {
              err := d.data_7.Out(gpio.High)
              if err != nil {
      Severity: Minor
      Found in section-3-backend-server/main.go - About 4 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 main has a Cognitive Complexity of 42 (exceeds 20 allowed). Consider refactoring.
      Open

      func main() {
      
          fmt.Println("Working on browser")
      
          // INIT HOST MACHINE (i.e. Raspberry Pi)
      Severity: Minor
      Found in section-3-backend-server/main.go - 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

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

      function data_in_a_zero_0_onclick() {
        switch(data_in_a_0_state) {
            case "high":
                data_in_a_0_state = "low";
                console.log("data_in_a_0_state = " + data_in_a_0_state);
      Severity: Major
      Found in section-4-web-server/control-an-fpga/js/opcode.js and 2 other locations - About 3 hrs to fix
      section-4-web-server/control-an-fpga/js/opcode.js on lines 279..289
      section-4-web-server/control-an-fpga/js/opcode.js on lines 1277..1287

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

      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 3 locations. Consider refactoring.
      Open

      function data_in_b_zero_0_onclick() {
      switch(data_in_b_0_state) {
          case "high":
              data_in_b_0_state = "low";
              console.log("data_in_b_0_state = " + data_in_b_0_state);
      Severity: Major
      Found in section-4-web-server/control-an-fpga/js/opcode.js and 2 other locations - About 3 hrs to fix
      section-4-web-server/control-an-fpga/js/opcode.js on lines 279..289
      section-4-web-server/control-an-fpga/js/opcode.js on lines 778..788

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

      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 3 locations. Consider refactoring.
      Open

      function opcode_zero_0_onclick() {
          switch(opcode_0_state) {
              case "high":
                  opcode_0_state = "low";
                  console.log("opcode_0_state = " + opcode_0_state);
      Severity: Major
      Found in section-4-web-server/control-an-fpga/js/opcode.js and 2 other locations - About 3 hrs to fix
      section-4-web-server/control-an-fpga/js/opcode.js on lines 778..788
      section-4-web-server/control-an-fpga/js/opcode.js on lines 1277..1287

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

      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

      File try-it.php has 314 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <!-- try-it -->
      
      <link rel="stylesheet" type="text/css" href="css/try-it.css">
      <link rel="stylesheet" type="text/css" href="css/browser_body.css">
      <script type="text/javascript" src="js/opcode.js"></script>
      Severity: Minor
      Found in section-4-web-server/control-an-fpga/try-it/try-it.php - About 3 hrs to fix

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

        function data_in_a_one_0_onclick() {
          switch(data_in_a_0_state) {
              case "low":
                  data_in_a_0_state = "high";
                  console.log("data_in_a_0_state = " + data_in_a_0_state);
        Severity: Major
        Found in section-4-web-server/control-an-fpga/js/opcode.js and 36 other locations - About 3 hrs to fix
        section-4-web-server/control-an-fpga/js/opcode.js on lines 62..72
        section-4-web-server/control-an-fpga/js/opcode.js on lines 93..103
        section-4-web-server/control-an-fpga/js/opcode.js on lines 124..134
        section-4-web-server/control-an-fpga/js/opcode.js on lines 155..165
        section-4-web-server/control-an-fpga/js/opcode.js on lines 186..196
        section-4-web-server/control-an-fpga/js/opcode.js on lines 217..227
        section-4-web-server/control-an-fpga/js/opcode.js on lines 248..258
        section-4-web-server/control-an-fpga/js/opcode.js on lines 313..323
        section-4-web-server/control-an-fpga/js/opcode.js on lines 344..354
        section-4-web-server/control-an-fpga/js/opcode.js on lines 375..385
        section-4-web-server/control-an-fpga/js/opcode.js on lines 406..416
        section-4-web-server/control-an-fpga/js/opcode.js on lines 437..447
        section-4-web-server/control-an-fpga/js/opcode.js on lines 468..478
        section-4-web-server/control-an-fpga/js/opcode.js on lines 499..509
        section-4-web-server/control-an-fpga/js/opcode.js on lines 530..540
        section-4-web-server/control-an-fpga/js/opcode.js on lines 561..571
        section-4-web-server/control-an-fpga/js/opcode.js on lines 592..602
        section-4-web-server/control-an-fpga/js/opcode.js on lines 623..633
        section-4-web-server/control-an-fpga/js/opcode.js on lines 654..664
        section-4-web-server/control-an-fpga/js/opcode.js on lines 685..695
        section-4-web-server/control-an-fpga/js/opcode.js on lines 716..726
        section-4-web-server/control-an-fpga/js/opcode.js on lines 812..822
        section-4-web-server/control-an-fpga/js/opcode.js on lines 843..853
        section-4-web-server/control-an-fpga/js/opcode.js on lines 874..884
        section-4-web-server/control-an-fpga/js/opcode.js on lines 905..915
        section-4-web-server/control-an-fpga/js/opcode.js on lines 936..946
        section-4-web-server/control-an-fpga/js/opcode.js on lines 967..977
        section-4-web-server/control-an-fpga/js/opcode.js on lines 998..1008
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1029..1039
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1060..1070
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1091..1101
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1122..1132
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1153..1163
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1184..1194
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1215..1225
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1246..1256

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

        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 37 locations. Consider refactoring.
        Open

        function data_in_a_zero_1_onclick() {
          switch(data_in_a_1_state) {
              case "high":
                  data_in_a_1_state = "low";
                  console.log("data_in_a_1_state = " + data_in_a_1_state);
        Severity: Major
        Found in section-4-web-server/control-an-fpga/js/opcode.js and 36 other locations - About 3 hrs to fix
        section-4-web-server/control-an-fpga/js/opcode.js on lines 62..72
        section-4-web-server/control-an-fpga/js/opcode.js on lines 93..103
        section-4-web-server/control-an-fpga/js/opcode.js on lines 124..134
        section-4-web-server/control-an-fpga/js/opcode.js on lines 155..165
        section-4-web-server/control-an-fpga/js/opcode.js on lines 186..196
        section-4-web-server/control-an-fpga/js/opcode.js on lines 217..227
        section-4-web-server/control-an-fpga/js/opcode.js on lines 248..258
        section-4-web-server/control-an-fpga/js/opcode.js on lines 313..323
        section-4-web-server/control-an-fpga/js/opcode.js on lines 344..354
        section-4-web-server/control-an-fpga/js/opcode.js on lines 375..385
        section-4-web-server/control-an-fpga/js/opcode.js on lines 406..416
        section-4-web-server/control-an-fpga/js/opcode.js on lines 437..447
        section-4-web-server/control-an-fpga/js/opcode.js on lines 468..478
        section-4-web-server/control-an-fpga/js/opcode.js on lines 499..509
        section-4-web-server/control-an-fpga/js/opcode.js on lines 530..540
        section-4-web-server/control-an-fpga/js/opcode.js on lines 561..571
        section-4-web-server/control-an-fpga/js/opcode.js on lines 592..602
        section-4-web-server/control-an-fpga/js/opcode.js on lines 623..633
        section-4-web-server/control-an-fpga/js/opcode.js on lines 654..664
        section-4-web-server/control-an-fpga/js/opcode.js on lines 685..695
        section-4-web-server/control-an-fpga/js/opcode.js on lines 747..757
        section-4-web-server/control-an-fpga/js/opcode.js on lines 812..822
        section-4-web-server/control-an-fpga/js/opcode.js on lines 843..853
        section-4-web-server/control-an-fpga/js/opcode.js on lines 874..884
        section-4-web-server/control-an-fpga/js/opcode.js on lines 905..915
        section-4-web-server/control-an-fpga/js/opcode.js on lines 936..946
        section-4-web-server/control-an-fpga/js/opcode.js on lines 967..977
        section-4-web-server/control-an-fpga/js/opcode.js on lines 998..1008
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1029..1039
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1060..1070
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1091..1101
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1122..1132
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1153..1163
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1184..1194
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1215..1225
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1246..1256

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

        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 37 locations. Consider refactoring.
        Open

        function data_in_a_zero_7_onclick() {
            switch(data_in_a_7_state) {
                case "high":
                    data_in_a_7_state = "low";
                    console.log("data_in_a_7_state = " + data_in_a_7_state);
        Severity: Major
        Found in section-4-web-server/control-an-fpga/js/opcode.js and 36 other locations - About 3 hrs to fix
        section-4-web-server/control-an-fpga/js/opcode.js on lines 62..72
        section-4-web-server/control-an-fpga/js/opcode.js on lines 93..103
        section-4-web-server/control-an-fpga/js/opcode.js on lines 124..134
        section-4-web-server/control-an-fpga/js/opcode.js on lines 155..165
        section-4-web-server/control-an-fpga/js/opcode.js on lines 186..196
        section-4-web-server/control-an-fpga/js/opcode.js on lines 217..227
        section-4-web-server/control-an-fpga/js/opcode.js on lines 248..258
        section-4-web-server/control-an-fpga/js/opcode.js on lines 313..323
        section-4-web-server/control-an-fpga/js/opcode.js on lines 375..385
        section-4-web-server/control-an-fpga/js/opcode.js on lines 406..416
        section-4-web-server/control-an-fpga/js/opcode.js on lines 437..447
        section-4-web-server/control-an-fpga/js/opcode.js on lines 468..478
        section-4-web-server/control-an-fpga/js/opcode.js on lines 499..509
        section-4-web-server/control-an-fpga/js/opcode.js on lines 530..540
        section-4-web-server/control-an-fpga/js/opcode.js on lines 561..571
        section-4-web-server/control-an-fpga/js/opcode.js on lines 592..602
        section-4-web-server/control-an-fpga/js/opcode.js on lines 623..633
        section-4-web-server/control-an-fpga/js/opcode.js on lines 654..664
        section-4-web-server/control-an-fpga/js/opcode.js on lines 685..695
        section-4-web-server/control-an-fpga/js/opcode.js on lines 716..726
        section-4-web-server/control-an-fpga/js/opcode.js on lines 747..757
        section-4-web-server/control-an-fpga/js/opcode.js on lines 812..822
        section-4-web-server/control-an-fpga/js/opcode.js on lines 843..853
        section-4-web-server/control-an-fpga/js/opcode.js on lines 874..884
        section-4-web-server/control-an-fpga/js/opcode.js on lines 905..915
        section-4-web-server/control-an-fpga/js/opcode.js on lines 936..946
        section-4-web-server/control-an-fpga/js/opcode.js on lines 967..977
        section-4-web-server/control-an-fpga/js/opcode.js on lines 998..1008
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1029..1039
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1060..1070
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1091..1101
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1122..1132
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1153..1163
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1184..1194
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1215..1225
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1246..1256

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

        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 37 locations. Consider refactoring.
        Open

        function data_in_b_zero_5_onclick() {
          switch(data_in_b_5_state) {
              case "high":
                  data_in_b_5_state = "low";
                  console.log("data_in_b_5_state = " + data_in_b_5_state);
        Severity: Major
        Found in section-4-web-server/control-an-fpga/js/opcode.js and 36 other locations - About 3 hrs to fix
        section-4-web-server/control-an-fpga/js/opcode.js on lines 62..72
        section-4-web-server/control-an-fpga/js/opcode.js on lines 93..103
        section-4-web-server/control-an-fpga/js/opcode.js on lines 124..134
        section-4-web-server/control-an-fpga/js/opcode.js on lines 155..165
        section-4-web-server/control-an-fpga/js/opcode.js on lines 186..196
        section-4-web-server/control-an-fpga/js/opcode.js on lines 217..227
        section-4-web-server/control-an-fpga/js/opcode.js on lines 248..258
        section-4-web-server/control-an-fpga/js/opcode.js on lines 313..323
        section-4-web-server/control-an-fpga/js/opcode.js on lines 344..354
        section-4-web-server/control-an-fpga/js/opcode.js on lines 375..385
        section-4-web-server/control-an-fpga/js/opcode.js on lines 406..416
        section-4-web-server/control-an-fpga/js/opcode.js on lines 437..447
        section-4-web-server/control-an-fpga/js/opcode.js on lines 468..478
        section-4-web-server/control-an-fpga/js/opcode.js on lines 499..509
        section-4-web-server/control-an-fpga/js/opcode.js on lines 530..540
        section-4-web-server/control-an-fpga/js/opcode.js on lines 561..571
        section-4-web-server/control-an-fpga/js/opcode.js on lines 592..602
        section-4-web-server/control-an-fpga/js/opcode.js on lines 623..633
        section-4-web-server/control-an-fpga/js/opcode.js on lines 654..664
        section-4-web-server/control-an-fpga/js/opcode.js on lines 685..695
        section-4-web-server/control-an-fpga/js/opcode.js on lines 716..726
        section-4-web-server/control-an-fpga/js/opcode.js on lines 747..757
        section-4-web-server/control-an-fpga/js/opcode.js on lines 812..822
        section-4-web-server/control-an-fpga/js/opcode.js on lines 843..853
        section-4-web-server/control-an-fpga/js/opcode.js on lines 874..884
        section-4-web-server/control-an-fpga/js/opcode.js on lines 905..915
        section-4-web-server/control-an-fpga/js/opcode.js on lines 936..946
        section-4-web-server/control-an-fpga/js/opcode.js on lines 998..1008
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1029..1039
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1060..1070
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1091..1101
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1122..1132
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1153..1163
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1184..1194
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1215..1225
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1246..1256

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

        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 37 locations. Consider refactoring.
        Open

        function data_in_b_one_1_onclick() {
        switch(data_in_b_1_state) {
            case "low":
                data_in_b_1_state = "high";
                console.log("data_in_b_1_state = " + data_in_b_1_state);
        Severity: Major
        Found in section-4-web-server/control-an-fpga/js/opcode.js and 36 other locations - About 3 hrs to fix
        section-4-web-server/control-an-fpga/js/opcode.js on lines 62..72
        section-4-web-server/control-an-fpga/js/opcode.js on lines 93..103
        section-4-web-server/control-an-fpga/js/opcode.js on lines 124..134
        section-4-web-server/control-an-fpga/js/opcode.js on lines 155..165
        section-4-web-server/control-an-fpga/js/opcode.js on lines 186..196
        section-4-web-server/control-an-fpga/js/opcode.js on lines 217..227
        section-4-web-server/control-an-fpga/js/opcode.js on lines 248..258
        section-4-web-server/control-an-fpga/js/opcode.js on lines 313..323
        section-4-web-server/control-an-fpga/js/opcode.js on lines 344..354
        section-4-web-server/control-an-fpga/js/opcode.js on lines 375..385
        section-4-web-server/control-an-fpga/js/opcode.js on lines 406..416
        section-4-web-server/control-an-fpga/js/opcode.js on lines 437..447
        section-4-web-server/control-an-fpga/js/opcode.js on lines 468..478
        section-4-web-server/control-an-fpga/js/opcode.js on lines 499..509
        section-4-web-server/control-an-fpga/js/opcode.js on lines 530..540
        section-4-web-server/control-an-fpga/js/opcode.js on lines 561..571
        section-4-web-server/control-an-fpga/js/opcode.js on lines 592..602
        section-4-web-server/control-an-fpga/js/opcode.js on lines 623..633
        section-4-web-server/control-an-fpga/js/opcode.js on lines 654..664
        section-4-web-server/control-an-fpga/js/opcode.js on lines 685..695
        section-4-web-server/control-an-fpga/js/opcode.js on lines 716..726
        section-4-web-server/control-an-fpga/js/opcode.js on lines 747..757
        section-4-web-server/control-an-fpga/js/opcode.js on lines 812..822
        section-4-web-server/control-an-fpga/js/opcode.js on lines 843..853
        section-4-web-server/control-an-fpga/js/opcode.js on lines 874..884
        section-4-web-server/control-an-fpga/js/opcode.js on lines 905..915
        section-4-web-server/control-an-fpga/js/opcode.js on lines 936..946
        section-4-web-server/control-an-fpga/js/opcode.js on lines 967..977
        section-4-web-server/control-an-fpga/js/opcode.js on lines 998..1008
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1029..1039
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1060..1070
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1091..1101
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1122..1132
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1153..1163
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1215..1225
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1246..1256

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

        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 37 locations. Consider refactoring.
        Open

        function opcode_zero_2_onclick() {
            switch(opcode_2_state) {
                case "high":
                    opcode_2_state = "low";
                    console.log("opcode_2_state = " + opcode_2_state);
        Severity: Major
        Found in section-4-web-server/control-an-fpga/js/opcode.js and 36 other locations - About 3 hrs to fix
        section-4-web-server/control-an-fpga/js/opcode.js on lines 62..72
        section-4-web-server/control-an-fpga/js/opcode.js on lines 93..103
        section-4-web-server/control-an-fpga/js/opcode.js on lines 124..134
        section-4-web-server/control-an-fpga/js/opcode.js on lines 186..196
        section-4-web-server/control-an-fpga/js/opcode.js on lines 217..227
        section-4-web-server/control-an-fpga/js/opcode.js on lines 248..258
        section-4-web-server/control-an-fpga/js/opcode.js on lines 313..323
        section-4-web-server/control-an-fpga/js/opcode.js on lines 344..354
        section-4-web-server/control-an-fpga/js/opcode.js on lines 375..385
        section-4-web-server/control-an-fpga/js/opcode.js on lines 406..416
        section-4-web-server/control-an-fpga/js/opcode.js on lines 437..447
        section-4-web-server/control-an-fpga/js/opcode.js on lines 468..478
        section-4-web-server/control-an-fpga/js/opcode.js on lines 499..509
        section-4-web-server/control-an-fpga/js/opcode.js on lines 530..540
        section-4-web-server/control-an-fpga/js/opcode.js on lines 561..571
        section-4-web-server/control-an-fpga/js/opcode.js on lines 592..602
        section-4-web-server/control-an-fpga/js/opcode.js on lines 623..633
        section-4-web-server/control-an-fpga/js/opcode.js on lines 654..664
        section-4-web-server/control-an-fpga/js/opcode.js on lines 685..695
        section-4-web-server/control-an-fpga/js/opcode.js on lines 716..726
        section-4-web-server/control-an-fpga/js/opcode.js on lines 747..757
        section-4-web-server/control-an-fpga/js/opcode.js on lines 812..822
        section-4-web-server/control-an-fpga/js/opcode.js on lines 843..853
        section-4-web-server/control-an-fpga/js/opcode.js on lines 874..884
        section-4-web-server/control-an-fpga/js/opcode.js on lines 905..915
        section-4-web-server/control-an-fpga/js/opcode.js on lines 936..946
        section-4-web-server/control-an-fpga/js/opcode.js on lines 967..977
        section-4-web-server/control-an-fpga/js/opcode.js on lines 998..1008
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1029..1039
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1060..1070
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1091..1101
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1122..1132
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1153..1163
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1184..1194
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1215..1225
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1246..1256

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

        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 37 locations. Consider refactoring.
        Open

        function data_in_a_one_6_onclick() {
            switch(data_in_a_6_state) {
                case "low":
                    data_in_a_6_state = "high";
                    console.log("data_in_a_6_state = " + data_in_a_6_state);
        Severity: Major
        Found in section-4-web-server/control-an-fpga/js/opcode.js and 36 other locations - About 3 hrs to fix
        section-4-web-server/control-an-fpga/js/opcode.js on lines 62..72
        section-4-web-server/control-an-fpga/js/opcode.js on lines 93..103
        section-4-web-server/control-an-fpga/js/opcode.js on lines 124..134
        section-4-web-server/control-an-fpga/js/opcode.js on lines 155..165
        section-4-web-server/control-an-fpga/js/opcode.js on lines 186..196
        section-4-web-server/control-an-fpga/js/opcode.js on lines 217..227
        section-4-web-server/control-an-fpga/js/opcode.js on lines 248..258
        section-4-web-server/control-an-fpga/js/opcode.js on lines 313..323
        section-4-web-server/control-an-fpga/js/opcode.js on lines 344..354
        section-4-web-server/control-an-fpga/js/opcode.js on lines 406..416
        section-4-web-server/control-an-fpga/js/opcode.js on lines 437..447
        section-4-web-server/control-an-fpga/js/opcode.js on lines 468..478
        section-4-web-server/control-an-fpga/js/opcode.js on lines 499..509
        section-4-web-server/control-an-fpga/js/opcode.js on lines 530..540
        section-4-web-server/control-an-fpga/js/opcode.js on lines 561..571
        section-4-web-server/control-an-fpga/js/opcode.js on lines 592..602
        section-4-web-server/control-an-fpga/js/opcode.js on lines 623..633
        section-4-web-server/control-an-fpga/js/opcode.js on lines 654..664
        section-4-web-server/control-an-fpga/js/opcode.js on lines 685..695
        section-4-web-server/control-an-fpga/js/opcode.js on lines 716..726
        section-4-web-server/control-an-fpga/js/opcode.js on lines 747..757
        section-4-web-server/control-an-fpga/js/opcode.js on lines 812..822
        section-4-web-server/control-an-fpga/js/opcode.js on lines 843..853
        section-4-web-server/control-an-fpga/js/opcode.js on lines 874..884
        section-4-web-server/control-an-fpga/js/opcode.js on lines 905..915
        section-4-web-server/control-an-fpga/js/opcode.js on lines 936..946
        section-4-web-server/control-an-fpga/js/opcode.js on lines 967..977
        section-4-web-server/control-an-fpga/js/opcode.js on lines 998..1008
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1029..1039
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1060..1070
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1091..1101
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1122..1132
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1153..1163
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1184..1194
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1215..1225
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1246..1256

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

        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 37 locations. Consider refactoring.
        Open

        function data_in_a_zero_4_onclick() {
          switch(data_in_a_4_state) {
              case "high":
                  data_in_a_4_state = "low";
                  console.log("data_in_a_4_state = " + data_in_a_4_state);
        Severity: Major
        Found in section-4-web-server/control-an-fpga/js/opcode.js and 36 other locations - About 3 hrs to fix
        section-4-web-server/control-an-fpga/js/opcode.js on lines 62..72
        section-4-web-server/control-an-fpga/js/opcode.js on lines 93..103
        section-4-web-server/control-an-fpga/js/opcode.js on lines 124..134
        section-4-web-server/control-an-fpga/js/opcode.js on lines 155..165
        section-4-web-server/control-an-fpga/js/opcode.js on lines 186..196
        section-4-web-server/control-an-fpga/js/opcode.js on lines 217..227
        section-4-web-server/control-an-fpga/js/opcode.js on lines 248..258
        section-4-web-server/control-an-fpga/js/opcode.js on lines 313..323
        section-4-web-server/control-an-fpga/js/opcode.js on lines 344..354
        section-4-web-server/control-an-fpga/js/opcode.js on lines 375..385
        section-4-web-server/control-an-fpga/js/opcode.js on lines 406..416
        section-4-web-server/control-an-fpga/js/opcode.js on lines 437..447
        section-4-web-server/control-an-fpga/js/opcode.js on lines 468..478
        section-4-web-server/control-an-fpga/js/opcode.js on lines 499..509
        section-4-web-server/control-an-fpga/js/opcode.js on lines 561..571
        section-4-web-server/control-an-fpga/js/opcode.js on lines 592..602
        section-4-web-server/control-an-fpga/js/opcode.js on lines 623..633
        section-4-web-server/control-an-fpga/js/opcode.js on lines 654..664
        section-4-web-server/control-an-fpga/js/opcode.js on lines 685..695
        section-4-web-server/control-an-fpga/js/opcode.js on lines 716..726
        section-4-web-server/control-an-fpga/js/opcode.js on lines 747..757
        section-4-web-server/control-an-fpga/js/opcode.js on lines 812..822
        section-4-web-server/control-an-fpga/js/opcode.js on lines 843..853
        section-4-web-server/control-an-fpga/js/opcode.js on lines 874..884
        section-4-web-server/control-an-fpga/js/opcode.js on lines 905..915
        section-4-web-server/control-an-fpga/js/opcode.js on lines 936..946
        section-4-web-server/control-an-fpga/js/opcode.js on lines 967..977
        section-4-web-server/control-an-fpga/js/opcode.js on lines 998..1008
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1029..1039
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1060..1070
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1091..1101
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1122..1132
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1153..1163
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1184..1194
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1215..1225
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1246..1256

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

        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 37 locations. Consider refactoring.
        Open

        function data_in_b_zero_1_onclick() {
        switch(data_in_b_1_state) {
            case "high":
                data_in_b_1_state = "low";
                console.log("data_in_b_1_state = " + data_in_b_1_state);
        Severity: Major
        Found in section-4-web-server/control-an-fpga/js/opcode.js and 36 other locations - About 3 hrs to fix
        section-4-web-server/control-an-fpga/js/opcode.js on lines 62..72
        section-4-web-server/control-an-fpga/js/opcode.js on lines 93..103
        section-4-web-server/control-an-fpga/js/opcode.js on lines 124..134
        section-4-web-server/control-an-fpga/js/opcode.js on lines 155..165
        section-4-web-server/control-an-fpga/js/opcode.js on lines 186..196
        section-4-web-server/control-an-fpga/js/opcode.js on lines 217..227
        section-4-web-server/control-an-fpga/js/opcode.js on lines 248..258
        section-4-web-server/control-an-fpga/js/opcode.js on lines 313..323
        section-4-web-server/control-an-fpga/js/opcode.js on lines 344..354
        section-4-web-server/control-an-fpga/js/opcode.js on lines 375..385
        section-4-web-server/control-an-fpga/js/opcode.js on lines 406..416
        section-4-web-server/control-an-fpga/js/opcode.js on lines 437..447
        section-4-web-server/control-an-fpga/js/opcode.js on lines 468..478
        section-4-web-server/control-an-fpga/js/opcode.js on lines 499..509
        section-4-web-server/control-an-fpga/js/opcode.js on lines 530..540
        section-4-web-server/control-an-fpga/js/opcode.js on lines 561..571
        section-4-web-server/control-an-fpga/js/opcode.js on lines 592..602
        section-4-web-server/control-an-fpga/js/opcode.js on lines 623..633
        section-4-web-server/control-an-fpga/js/opcode.js on lines 654..664
        section-4-web-server/control-an-fpga/js/opcode.js on lines 685..695
        section-4-web-server/control-an-fpga/js/opcode.js on lines 716..726
        section-4-web-server/control-an-fpga/js/opcode.js on lines 747..757
        section-4-web-server/control-an-fpga/js/opcode.js on lines 812..822
        section-4-web-server/control-an-fpga/js/opcode.js on lines 843..853
        section-4-web-server/control-an-fpga/js/opcode.js on lines 874..884
        section-4-web-server/control-an-fpga/js/opcode.js on lines 905..915
        section-4-web-server/control-an-fpga/js/opcode.js on lines 936..946
        section-4-web-server/control-an-fpga/js/opcode.js on lines 967..977
        section-4-web-server/control-an-fpga/js/opcode.js on lines 998..1008
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1029..1039
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1060..1070
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1091..1101
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1122..1132
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1153..1163
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1184..1194
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1246..1256

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

        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 37 locations. Consider refactoring.
        Open

        function data_in_a_zero_5_onclick() {
            switch(data_in_a_5_state) {
                case "high":
                    data_in_a_5_state = "low";
                    console.log("data_in_a_5_state = " + data_in_a_5_state);
        Severity: Major
        Found in section-4-web-server/control-an-fpga/js/opcode.js and 36 other locations - About 3 hrs to fix
        section-4-web-server/control-an-fpga/js/opcode.js on lines 62..72
        section-4-web-server/control-an-fpga/js/opcode.js on lines 93..103
        section-4-web-server/control-an-fpga/js/opcode.js on lines 124..134
        section-4-web-server/control-an-fpga/js/opcode.js on lines 155..165
        section-4-web-server/control-an-fpga/js/opcode.js on lines 186..196
        section-4-web-server/control-an-fpga/js/opcode.js on lines 217..227
        section-4-web-server/control-an-fpga/js/opcode.js on lines 248..258
        section-4-web-server/control-an-fpga/js/opcode.js on lines 313..323
        section-4-web-server/control-an-fpga/js/opcode.js on lines 344..354
        section-4-web-server/control-an-fpga/js/opcode.js on lines 375..385
        section-4-web-server/control-an-fpga/js/opcode.js on lines 406..416
        section-4-web-server/control-an-fpga/js/opcode.js on lines 437..447
        section-4-web-server/control-an-fpga/js/opcode.js on lines 499..509
        section-4-web-server/control-an-fpga/js/opcode.js on lines 530..540
        section-4-web-server/control-an-fpga/js/opcode.js on lines 561..571
        section-4-web-server/control-an-fpga/js/opcode.js on lines 592..602
        section-4-web-server/control-an-fpga/js/opcode.js on lines 623..633
        section-4-web-server/control-an-fpga/js/opcode.js on lines 654..664
        section-4-web-server/control-an-fpga/js/opcode.js on lines 685..695
        section-4-web-server/control-an-fpga/js/opcode.js on lines 716..726
        section-4-web-server/control-an-fpga/js/opcode.js on lines 747..757
        section-4-web-server/control-an-fpga/js/opcode.js on lines 812..822
        section-4-web-server/control-an-fpga/js/opcode.js on lines 843..853
        section-4-web-server/control-an-fpga/js/opcode.js on lines 874..884
        section-4-web-server/control-an-fpga/js/opcode.js on lines 905..915
        section-4-web-server/control-an-fpga/js/opcode.js on lines 936..946
        section-4-web-server/control-an-fpga/js/opcode.js on lines 967..977
        section-4-web-server/control-an-fpga/js/opcode.js on lines 998..1008
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1029..1039
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1060..1070
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1091..1101
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1122..1132
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1153..1163
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1184..1194
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1215..1225
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1246..1256

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

        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 37 locations. Consider refactoring.
        Open

        function opcode_zero_3_onclick() {
            switch(opcode_3_state) {
                case "high":
                    opcode_3_state = "low";
                    console.log("opcode_3_state = " + opcode_3_state);
        Severity: Major
        Found in section-4-web-server/control-an-fpga/js/opcode.js and 36 other locations - About 3 hrs to fix
        section-4-web-server/control-an-fpga/js/opcode.js on lines 62..72
        section-4-web-server/control-an-fpga/js/opcode.js on lines 124..134
        section-4-web-server/control-an-fpga/js/opcode.js on lines 155..165
        section-4-web-server/control-an-fpga/js/opcode.js on lines 186..196
        section-4-web-server/control-an-fpga/js/opcode.js on lines 217..227
        section-4-web-server/control-an-fpga/js/opcode.js on lines 248..258
        section-4-web-server/control-an-fpga/js/opcode.js on lines 313..323
        section-4-web-server/control-an-fpga/js/opcode.js on lines 344..354
        section-4-web-server/control-an-fpga/js/opcode.js on lines 375..385
        section-4-web-server/control-an-fpga/js/opcode.js on lines 406..416
        section-4-web-server/control-an-fpga/js/opcode.js on lines 437..447
        section-4-web-server/control-an-fpga/js/opcode.js on lines 468..478
        section-4-web-server/control-an-fpga/js/opcode.js on lines 499..509
        section-4-web-server/control-an-fpga/js/opcode.js on lines 530..540
        section-4-web-server/control-an-fpga/js/opcode.js on lines 561..571
        section-4-web-server/control-an-fpga/js/opcode.js on lines 592..602
        section-4-web-server/control-an-fpga/js/opcode.js on lines 623..633
        section-4-web-server/control-an-fpga/js/opcode.js on lines 654..664
        section-4-web-server/control-an-fpga/js/opcode.js on lines 685..695
        section-4-web-server/control-an-fpga/js/opcode.js on lines 716..726
        section-4-web-server/control-an-fpga/js/opcode.js on lines 747..757
        section-4-web-server/control-an-fpga/js/opcode.js on lines 812..822
        section-4-web-server/control-an-fpga/js/opcode.js on lines 843..853
        section-4-web-server/control-an-fpga/js/opcode.js on lines 874..884
        section-4-web-server/control-an-fpga/js/opcode.js on lines 905..915
        section-4-web-server/control-an-fpga/js/opcode.js on lines 936..946
        section-4-web-server/control-an-fpga/js/opcode.js on lines 967..977
        section-4-web-server/control-an-fpga/js/opcode.js on lines 998..1008
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1029..1039
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1060..1070
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1091..1101
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1122..1132
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1153..1163
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1184..1194
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1215..1225
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1246..1256

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

        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 37 locations. Consider refactoring.
        Open

        function data_in_a_zero_6_onclick() {
            switch(data_in_a_6_state) {
                case "high":
                    data_in_a_6_state = "low";
                    console.log("data_in_a_6_state = " + data_in_a_6_state);
        Severity: Major
        Found in section-4-web-server/control-an-fpga/js/opcode.js and 36 other locations - About 3 hrs to fix
        section-4-web-server/control-an-fpga/js/opcode.js on lines 62..72
        section-4-web-server/control-an-fpga/js/opcode.js on lines 93..103
        section-4-web-server/control-an-fpga/js/opcode.js on lines 124..134
        section-4-web-server/control-an-fpga/js/opcode.js on lines 155..165
        section-4-web-server/control-an-fpga/js/opcode.js on lines 186..196
        section-4-web-server/control-an-fpga/js/opcode.js on lines 217..227
        section-4-web-server/control-an-fpga/js/opcode.js on lines 248..258
        section-4-web-server/control-an-fpga/js/opcode.js on lines 313..323
        section-4-web-server/control-an-fpga/js/opcode.js on lines 344..354
        section-4-web-server/control-an-fpga/js/opcode.js on lines 375..385
        section-4-web-server/control-an-fpga/js/opcode.js on lines 437..447
        section-4-web-server/control-an-fpga/js/opcode.js on lines 468..478
        section-4-web-server/control-an-fpga/js/opcode.js on lines 499..509
        section-4-web-server/control-an-fpga/js/opcode.js on lines 530..540
        section-4-web-server/control-an-fpga/js/opcode.js on lines 561..571
        section-4-web-server/control-an-fpga/js/opcode.js on lines 592..602
        section-4-web-server/control-an-fpga/js/opcode.js on lines 623..633
        section-4-web-server/control-an-fpga/js/opcode.js on lines 654..664
        section-4-web-server/control-an-fpga/js/opcode.js on lines 685..695
        section-4-web-server/control-an-fpga/js/opcode.js on lines 716..726
        section-4-web-server/control-an-fpga/js/opcode.js on lines 747..757
        section-4-web-server/control-an-fpga/js/opcode.js on lines 812..822
        section-4-web-server/control-an-fpga/js/opcode.js on lines 843..853
        section-4-web-server/control-an-fpga/js/opcode.js on lines 874..884
        section-4-web-server/control-an-fpga/js/opcode.js on lines 905..915
        section-4-web-server/control-an-fpga/js/opcode.js on lines 936..946
        section-4-web-server/control-an-fpga/js/opcode.js on lines 967..977
        section-4-web-server/control-an-fpga/js/opcode.js on lines 998..1008
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1029..1039
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1060..1070
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1091..1101
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1122..1132
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1153..1163
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1184..1194
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1215..1225
        section-4-web-server/control-an-fpga/js/opcode.js on lines 1246..1256

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

        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

        Severity
        Category
        Status
        Source
        Language