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 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
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 {
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) {
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) {
2: cannot find package "periph.io/x/conn/v3/gpio" in any of: Open
"periph.io/x/conn/v3/gpio"
- Exclude checks
don't use underscores in Go names; struct field data_3 should be data3 Open
data_3 gpio.PinIO
- Exclude checks
don't use underscores in Go names; struct field data_1 should be data1 Open
data_1 gpio.PinIO
- Exclude checks
don't use underscores in Go names; struct field data_7 should be data7 Open
data_7 gpio.PinIO
- Exclude checks
don't use underscores in Go names; type data_a_pins should be dataAPins Open
type data_a_pins struct {
- Exclude checks
don't use underscores in Go names; struct field data_2 should be data2 Open
data_2 gpio.PinIO
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase 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) {
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase Open
DATA_IN_B5_PIN := gpioreg.ByName("20")
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase Open
DATA_OUT_2_PIN := gpioreg.ByName("6")
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase Open
DATA_OUT_0_PIN := gpioreg.ByName("19")
- Exclude checks
don't use underscores in Go names; struct field opcode_1 should be opcode1 Open
opcode_1 gpio.PinIO
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase 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) {
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase Open
DATA_IN_A3_PIN := gpioreg.ByName("23")
- Exclude checks
don't use underscores in Go names; struct field data_7 should be data7 Open
data_7 gpio.PinIO
- Exclude checks
don't use underscores in Go names; method write_data_in should be writeDataIn Open
func (d data_pins) write_data_in(d7 int, d6 int, d5 int, d4 int, d3 int, d2 int, d1 int, d0 int) {
- Exclude checks
don't use underscores in Go names; struct field data_6 should be data6 Open
data_6 gpio.PinIO
- Exclude checks
don't use underscores in Go names; method write_opcode should be writeOpcode Open
func (o opcode_pins) write_opcode(o3 int, o2 int, o1 int, o0 int) {
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase Open
DATA_IN_A1_PIN := gpioreg.ByName("15")
- Exclude checks
don't use underscores in Go names; method write_data_in_a should be writeDataInA Open
func (d data_a_pins) write_data_in_a(d7 int, d3 int, d2 int, d1 int, d0 int) {
- Exclude checks
don't use underscores in Go names; func execute_opcode should be executeOpcode Open
func execute_opcode(go_bar_pin gpio.PinIO, data_out data_pins) {
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase Open
DATA_IN_B1_PIN := gpioreg.ByName("8")
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase Open
DATA_IN_A7_PIN := gpioreg.ByName("24")
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase Open
DATA_OUT_4_PIN := gpioreg.ByName("11")
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase Open
DATA_OUT_3_PIN := gpioreg.ByName("5")
- Exclude checks
don't use underscores in Go names; var data_out should be dataOut Open
data_out := data_pins{DATA_OUT_7_PIN, DATA_OUT_6_PIN, DATA_OUT_5_PIN, DATA_OUT_4_PIN, DATA_OUT_3_PIN, DATA_OUT_2_PIN, DATA_OUT_1_PIN, DATA_OUT_0_PIN}
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase Open
RESET_PIN := gpioreg.ByName("0")
- Exclude checks
don't use underscores in Go names; struct field opcode_2 should be opcode2 Open
opcode_2 gpio.PinIO
- Exclude checks
don't use underscores in Go names; func parameter data_in_b should be dataInB 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) {
- Exclude checks
don't use underscores in Go names; func parameter data_out should be dataOut 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) {
- Exclude checks
don't use underscores in Go names; var DATA_OUT_4_PIN_Level should be DATAOUT4PINLevel Open
DATA_OUT_4_PIN_Level := d.data_4.Read()
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase Open
OPCODE_2_PIN := gpioreg.ByName("3")
- Exclude checks
don't use underscores in Go names; struct field data_3 should be data3 Open
data_3 gpio.PinIO
- Exclude checks
don't use underscores in Go names; var DATA_OUT_2_PIN_Level should be DATAOUT2PINLevel Open
DATA_OUT_2_PIN_Level := d.data_2.Read()
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase Open
DATA_IN_B0_PIN := gpioreg.ByName("25")
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase Open
DATA_OUT_5_PIN := gpioreg.ByName("9")
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase Open
JAM_PIN := gpioreg.ByName("1")
- Exclude checks
don't use underscores in Go names; struct field data_2 should be data2 Open
data_2 gpio.PinIO
- Exclude checks
don't use underscores in Go names; var DATA_OUT_0_PIN_Level should be DATAOUT0PINLevel Open
DATA_OUT_0_PIN_Level := d.data_0.Read()
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase Open
DATA_IN_A2_PIN := gpioreg.ByName("18")
- Exclude checks
don't use underscores in Go names; var data_in_b should be dataInB Open
data_in_b := data_pins{DATA_IN_B7_PIN, DATA_IN_B6_PIN, DATA_IN_B5_PIN, DATA_IN_B4_PIN, DATA_IN_B3_PIN, DATA_IN_B2_PIN, DATA_IN_B1_PIN, DATA_IN_B0_PIN}
- Exclude checks
don't use underscores in Go names; var data_in_a should be dataInA Open
data_in_a := data_a_pins{DATA_IN_A7_PIN, DATA_IN_A3_PIN, DATA_IN_A2_PIN, DATA_IN_A1_PIN, DATA_IN_A0_PIN}
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase Open
DATA_IN_B7_PIN := gpioreg.ByName("26")
- Exclude checks
don't use underscores in Go names; method read_data_out should be readDataOut Open
func (d data_pins) read_data_out() {
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase Open
OPCODE_0_PIN := gpioreg.ByName("17")
- Exclude checks
don't use underscores in Go names; var DATA_OUT_6_PIN_Level should be DATAOUT6PINLevel Open
DATA_OUT_6_PIN_Level := d.data_6.Read()
- Exclude checks
don't use underscores in Go names; var DATA_OUT_3_PIN_Level should be DATAOUT3PINLevel Open
DATA_OUT_3_PIN_Level := d.data_3.Read()
- Exclude checks
don't use underscores in Go names; func parameter go_bar_pin should be goBarPin Open
func execute_opcode(go_bar_pin gpio.PinIO, data_out data_pins) {
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase Open
GO_BAR_PIN := gpioreg.ByName("27")
- Exclude checks
don't use underscores in Go names; struct field data_1 should be data1 Open
data_1 gpio.PinIO
- Exclude checks
exported function UserControl should have comment or be unexported 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) {
- Exclude checks
don't use underscores in Go names; var DATA_OUT_1_PIN_Level should be DATAOUT1PINLevel Open
DATA_OUT_1_PIN_Level := d.data_1.Read()
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase Open
DATA_IN_B3_PIN := gpioreg.ByName("12")
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase Open
DATA_OUT_7_PIN := gpioreg.ByName("22")
- Exclude checks
don't use underscores in Go names; struct field data_4 should be data4 Open
data_4 gpio.PinIO
- Exclude checks
don't use underscores in Go names; struct field opcode_0 should be opcode0 Open
opcode_0 gpio.PinIO
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase 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) {
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase Open
OPCODE_3_PIN := gpioreg.ByName("2")
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase Open
OPCODE_1_PIN := gpioreg.ByName("4")
- Exclude checks
don't use underscores in Go names; struct field data_0 should be data0 Open
data_0 gpio.PinIO
- Exclude checks
don't use underscores in Go names; struct field opcode_3 should be opcode3 Open
opcode_3 gpio.PinIO
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase Open
DATA_IN_A0_PIN := gpioreg.ByName("14")
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase Open
DATA_IN_B4_PIN := gpioreg.ByName("16")
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase Open
DATA_IN_B2_PIN := gpioreg.ByName("7")
- Exclude checks
don't use underscores in Go names; struct field data_5 should be data5 Open
data_5 gpio.PinIO
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase Open
DATA_IN_B6_PIN := gpioreg.ByName("21")
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase Open
DATA_OUT_6_PIN := gpioreg.ByName("10")
- Exclude checks
don't use underscores in Go names; struct field data_0 should be data0 Open
data_0 gpio.PinIO
- Exclude checks
don't use underscores in Go names; type opcode_pins should be opcodePins Open
type opcode_pins struct {
- Exclude checks
don't use underscores in Go names; func parameter data_in_a should be dataInA 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) {
- Exclude checks
don't use ALL_CAPS in Go names; use CamelCase Open
DATA_OUT_1_PIN := gpioreg.ByName("13")
- Exclude checks
don't use underscores in Go names; type data_pins should be dataPins Open
type data_pins struct {
- Exclude checks
don't use underscores in Go names; var DATA_OUT_7_PIN_Level should be DATAOUT7PINLevel Open
DATA_OUT_7_PIN_Level := d.data_7.Read()
- Exclude checks
don't use underscores in Go names; var DATA_OUT_5_PIN_Level should be DATAOUT5PINLevel Open
DATA_OUT_5_PIN_Level := d.data_5.Read()
- Exclude checks
don't use underscores in Go names; func parameter data_out should be dataOut Open
func execute_opcode(go_bar_pin gpio.PinIO, data_out data_pins) {
- Exclude checks