diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-08-02 16:55:29 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-08-02 16:57:32 +0200 |
| commit | 5cbdd9f4445514cbacadc362c2891e40b7f36072 (patch) | |
| tree | 6c46fa812fba9dbf71819bed15669363f5fab8e6 | |
| parent | 88d4a8fc562c4fe8f975446854358c99c4c876d1 (diff) | |
gometalinter: strengthen gocyclo limit
Strengthen gocycle limit 35->24! Yay! No more jumbo functions!
Fixes #538
| -rw-r--r-- | .gometalinter.json | 2 | ||||
| -rw-r--r-- | pkg/host/host_linux.go | 4 | ||||
| -rw-r--r-- | pkg/report/linux.go | 2 |
3 files changed, 7 insertions, 1 deletions
diff --git a/.gometalinter.json b/.gometalinter.json index 9eb78e6f5..856e892fb 100644 --- a/.gometalinter.json +++ b/.gometalinter.json @@ -5,7 +5,7 @@ "sort": ["path", "line"], "minconstlength": 7, "linelength": 120, - "cyclo": 35, + "cyclo": 24, "duplthreshold": 60, "skip": [ "pkg/kd", diff --git a/pkg/host/host_linux.go b/pkg/host/host_linux.go index 6d7c9c516..16be1d578 100644 --- a/pkg/host/host_linux.go +++ b/pkg/host/host_linux.go @@ -122,6 +122,10 @@ var ( filesystemsOnce sync.Once ) +// The function is lengthy as it handles all pseudo-syscalls, +// but it does not seem to cause comprehension problems as there is no shared state. +// Splitting this per-syscall will only increase code size. +// nolint: gocyclo func isSupportedSyzkall(sandbox string, c *prog.Syscall) (bool, string) { switch c.CallName { case "syz_open_dev": diff --git a/pkg/report/linux.go b/pkg/report/linux.go index 892c6d53a..03c9e4a4a 100644 --- a/pkg/report/linux.go +++ b/pkg/report/linux.go @@ -162,6 +162,8 @@ func (ctx *linux) Parse(output []byte) *Report { return rep } +// Yes, it is complex, but all state and logic are tightly coupled. It's unclear how to simplify it. +// nolint: gocyclo func (ctx *linux) parseOutput(output []byte) ( oops *oops, startPos, endPos int, logReport, consoleReport, consoleReportReliable []byte, |
