Showing 18 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";
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)
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 {
- Read upRead up
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)
- Read upRead up
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
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>
File main.go
has 525 lines of code (exceeds 500 allowed). Consider refactoring. Open
// my-go-examples toggle-led-with-button-raspberry-pi-gpio-periph
package main
import (
Method data_pins.write_data_in
has 88 lines of code (exceeds 50 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 {
Method data_a_pins.write_data_in_a
has a Cognitive Complexity of 30 (exceeds 20 allowed). Consider refactoring. Open
func (d data_a_pins) write_data_in_a(d7 int, d3 int, d2 int, d1 int, d0 int) {
if d7 == 1 {
err := d.data_7.Out(gpio.High)
if err != nil {
- Read upRead up
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 compute
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function compute() {
console.log("STEP 4 - SEND OPCODE, DATA_IN_A, DATA_IN_B AND GO TO WEB SERVER");
document.getElementById("data_out_7").innerHTML=" ";
document.getElementById("data_out_6").innerHTML="W";
Function send_data_to_web_server
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function send_data_to_web_server(opcode, data_in_a, data_in_b, go) {
// CREATE A NEW REQUEST
postRequest = new XMLHttpRequest();
if (!postRequest) {
Method data_a_pins.write_data_in_a
has 55 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (d data_a_pins) write_data_in_a(d7 int, d3 int, d2 int, d1 int, d0 int) {
if d7 == 1 {
err := d.data_7.Out(gpio.High)
if err != nil {
Function show_data_out
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function show_data_out(data) {
console.log("SHOW DATA_OUT FROM FPGA");
console.log("data = " + data.data_out);
document.getElementById("data_out").classList.remove("pulse"); // PULSE DATA_OUT OFF
Function server_error
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function server_error() {
console.log("SERVER ERROR");
document.getElementById("data_out").classList.remove("pulse"); // PULSE DATA_OUT OFF
document.getElementById("html_interface_arrow_right").classList.remove("pulse"); // PULSE ARROW RIGHT OFF
Method data_pins.write_data_in
has 8 arguments (exceeds 4 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) {
Function send_data_to_web_server
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function send_data_to_web_server(opcode, data_in_a, data_in_b, go) {
// CREATE A NEW REQUEST
postRequest = new XMLHttpRequest();
if (!postRequest) {
- Read upRead up
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
Method opcode_pins.write_opcode
has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring. Open
func (o opcode_pins) write_opcode(o3 int, o2 int, o1 int, o0 int) {
if o3 == 1 {
err := o.opcode_3.Out(gpio.High)
if err != nil {
- Read upRead up
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 UserControl
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
func UserControl(opcode opcode_pins, data_in_a data_a_pins, data_in_b data_pins, GO_BAR_PIN gpio.PinIO, RESET_PIN gpio.PinIO, JAM_PIN gpio.PinIO, data_out data_pins) {
Method data_a_pins.write_data_in_a
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
func (d data_a_pins) write_data_in_a(d7 int, d3 int, d2 int, d1 int, d0 int) {