Skip to content

Commit

Permalink
ignore gocyclo issue, temporary
Browse files Browse the repository at this point in the history
  • Loading branch information
mrpalide committed Nov 10, 2024
1 parent 69b7120 commit 1dd414b
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 2 deletions.
3 changes: 3 additions & 0 deletions cmd/skywire-cli/commands/log/st.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ var stCmd = &cobra.Command{
},
}

// TODO: fix gocyclo error.
//
//gocyclo:ignore
func makeTree() {
utFileInfo, utFileInfoErr := os.Stat("/tmp/ut.json")
utData, utDataErr := script.File("/tmp/ut.json").String()
Expand Down
3 changes: 3 additions & 0 deletions cmd/skywire-cli/commands/rewards/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ var htmlRewardPageTemplate = `
var htmlPageTemplateData htmlTemplateData
var tmpl *htmpl.Template

// TODO: fix gocyclo error.
//
//gocyclo:ignore
func server() {

log := logging.MustGetLogger("dmsghttp")
Expand Down
9 changes: 9 additions & 0 deletions cmd/skywire-cli/commands/visor/top.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ var (
//go:embed "description.txt"
var description string

// TODO: fix gocyclo error.
//
//gocyclo:ignore
func parseArgs() error {
cds := conf.ConfigDir.QueryFolders(configdir.All)
cpaths := make([]string, len(cds))
Expand Down Expand Up @@ -226,6 +229,9 @@ func setDefaultTermuiColors(c gotop.Config) {
ui.Theme.Block.Border = ui.NewStyle(ui.Color(c.Colorscheme.BorderLine), ui.Color(c.Colorscheme.Bg))
}

// TODO: fix gocyclo error.
//
//gocyclo:ignore
func eventLoop(c gotop.Config, grid *layout.MyGrid) {
drawTicker := time.NewTicker(c.UpdateInterval).C

Expand Down Expand Up @@ -408,6 +414,9 @@ func eventLoop(c gotop.Config, grid *layout.MyGrid) {
}
}

// TODO: fix gocyclo error.
//
//gocyclo:ignore
func run() int {
ling, err := lingo.New("en_US", ".", gotop.Dicts)
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions internal/vpn/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,9 @@ func (c *Client) setupTUN(tunIP, tunGateway net.IP) error {
return c.SetupTUN(c.tun.Name(), tunIP.String()+TUNNetmaskCIDR, tunGateway.String(), TUNMTU)
}

// TODO: fix gocyclo error.
//
//gocyclo:ignore
func (c *Client) serveConn(conn net.Conn) error {
tunIP, tunGateway, err := c.shakeHands(conn)
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions internal/vpn/subnet_ip_incrementer.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ func newSubnetIPIncrementer(octetLowerBorders, octetBorders [4]uint8, step uint8
}
}

// TODO: fix gocyclo error.
//
//gocyclo:ignore
func (inc *subnetIPIncrementer) next() (net.IP, error) {
inc.mx.Lock()
defer inc.mx.Unlock()
Expand Down
3 changes: 3 additions & 0 deletions pkg/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,9 @@ func (r *router) serveSetup() {
}
}

// TODO: fix gocyclo error.
//
//gocyclo:ignore
func (r *router) saveRouteGroupRules(rules routing.EdgeRules, nsConf noise.Config) (*NoiseRouteGroup, error) {
r.logger.Debugf("Saving route group rules with desc: %s", &rules.Desc)

Expand Down
4 changes: 3 additions & 1 deletion pkg/visor/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ var (
isForceColor bool
)

// TODO: fix gocyclo error.
//
//gocyclo:ignore
func init() {

root = visorconfig.IsRoot()
RootCmd.Flags().SortFlags = false
//the default is not set to fix the aesthetic of the help command
Expand Down
4 changes: 3 additions & 1 deletion pkg/visor/hypervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,10 @@ func (hv *Hypervisor) getAppStats() http.HandlerFunc {
})
}

// TODO: simplify
// nolint: funlen,gocognit,godox
// TODO: fix gocyclo error.
//
//gocyclo:ignore
func (hv *Hypervisor) putApp() http.HandlerFunc {
return hv.withCtx(hv.appCtx, func(w http.ResponseWriter, r *http.Request, ctx *httpCtx) {
type req struct {
Expand Down
9 changes: 9 additions & 0 deletions pkg/visor/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,9 @@ func handlePingConn(log *logging.Logger, remoteConn net.Conn, v *Visor) {
}

// getRouteSetupHooks aka autotransport
// TODO: fix gocyclo error.
//
//gocyclo:ignore
func getRouteSetupHooks(ctx context.Context, v *Visor, log *logging.Logger) []router.RouteSetupHook {
retrier := netutil.NewRetrier(log, time.Second, time.Second*20, 3, 1.3)
return []router.RouteSetupHook{
Expand Down Expand Up @@ -1298,6 +1301,9 @@ func initEnsureVisorIsTransportable(ctx context.Context, v *Visor, log *logging.
return nil
}

// TODO: fix gocyclo error.
//
//gocyclo:ignore
func initEnsureTPDConcurrency(ctx context.Context, v *Visor, log *logging.Logger) error { //nolint:all
const tickDuration = 5 * time.Minute
ticker := time.NewTicker(tickDuration)
Expand Down Expand Up @@ -1408,6 +1414,9 @@ func initPublicVisor(_ context.Context, v *Visor, log *logging.Logger) error { /
return nil
}

// TODO: fix gocyclo error.
//
//gocyclo:ignore
func initDmsgpty(ctx context.Context, v *Visor, log *logging.Logger) error {
conf := v.conf.Dmsgpty

Expand Down
3 changes: 3 additions & 0 deletions pkg/visor/visorconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ func MakeBaseConfig(common *Common, testEnv bool, dmsgHTTP bool, services *Servi
// The config's 'sk' field will be nil if not specified.
// Generated config will be saved to 'confPath'.
// This function always returns the latest config version.
// TODO: fix gocyclo error.
//
//gocyclo:ignore
func MakeDefaultConfig(log *logging.MasterLogger, sk *cipher.SecKey, usrEnv bool, pkgEnv bool, testEnv bool, dmsgHTTP bool, hypervisor bool, confPath, hypervisorPKs string, services *Services) (*V1, error) {
if usrEnv && pkgEnv {
log.Fatal("usrEnv and pkgEnv are mutually exclusive")
Expand Down

0 comments on commit 1dd414b

Please sign in to comment.