Skip to content

Reportcard again #5679

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 2, 2019
Merged

Conversation

afbjorklund
Copy link
Collaborator

@afbjorklund afbjorklund commented Oct 21, 2019

Improve gofmt (!), golint and gocyclo.

Issues: 11
gofmt: 99%
	pkg/minikube/registry/global_test.go
		Line 1: warning: file is not gofmted with -s (gofmt)
go_vet: 100%
golint: 98%
	cmd/minikube/cmd/status.go
		Line 43: warning: exported var KubeconfigStatus should have comment or be unexported (golint)
	pkg/minikube/driver/driver.go
		Line 29: warning: exported const Mock should have comment (or a comment on this block) or be unexported (golint)
	pkg/minikube/driver/driver_linux.go
		Line 33: warning: exported function VBoxManagePath should have comment or be unexported (golint)
	pkg/minikube/registry/registry.go
		Line 32: warning: exported const Unknown should have comment (or a comment on this block) or be unexported (golint)
gocyclo: 98%
	cmd/minikube/cmd/start.go
		Line 272: warning: cyclomatic complexity 21 of function runStart() is high (> 15) (gocyclo)
		Line 982: warning: cyclomatic complexity 18 of function validateNetwork() is high (> 15) (gocyclo)
	test/integration/a_serial_test.go
		Line 38: warning: cyclomatic complexity 18 of function TestDownloadOnly() is high (> 15) (gocyclo)
	test/integration/fn_tunnel_cmd.go
		Line 40: warning: cyclomatic complexity 18 of function validateTunnelCmd() is high (> 15) (gocyclo)
	test/integration/gvisor_addon_test.go
		Line 29: warning: cyclomatic complexity 18 of function TestGvisorAddon() is high (> 15) (gocyclo)
	cmd/minikube/cmd/delete.go
		Line 177: warning: cyclomatic complexity 16 of function deleteProfile() is high (> 15) (gocyclo)
		Line 90: warning: cyclomatic complexity 16 of function runDelete() is high (> 15) (gocyclo)
	test/integration/fn_mount_cmd.go
		Line 46: warning: cyclomatic complexity 29 of function validateMountCmd() is high (> 15) (gocyclo)
ineffassign: 100%
license: 100%
misspell: 100%

The integration tests are tricky, they are by their nature sequential and require setup/takedown.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 21, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: afbjorklund

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 21, 2019
@codecov-io
Copy link

codecov-io commented Oct 21, 2019

Codecov Report

Merging #5679 into master will decrease coverage by 0.04%.
The diff coverage is 7.69%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5679      +/-   ##
==========================================
- Coverage   36.58%   36.54%   -0.05%     
==========================================
  Files         110      110              
  Lines        8096     8114      +18     
==========================================
+ Hits         2962     2965       +3     
- Misses       4745     4760      +15     
  Partials      389      389
Impacted Files Coverage Δ
pkg/minikube/driver/driver.go 95.74% <ø> (ø) ⬆️
pkg/minikube/driver/driver_linux.go 0% <ø> (ø) ⬆️
cmd/minikube/cmd/status.go 7.69% <ø> (ø) ⬆️
pkg/minikube/registry/registry.go 100% <ø> (ø) ⬆️
cmd/minikube/cmd/start.go 20% <0%> (-0.37%) ⬇️
cmd/minikube/cmd/delete.go 29.14% <30%> (+0.64%) ⬆️

Mostly by using the "extract method" pattern.

Here is the report (from gocyclo), before:

21 cmd runStart cmd/minikube/cmd/start.go:272:1
18 cmd validateNetwork cmd/minikube/cmd/start.go:982:1
16 cmd runDelete cmd/minikube/cmd/delete.go:90:1
16 cmd deleteProfile cmd/minikube/cmd/delete.go:177:1
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 26, 2019
@afbjorklund afbjorklund merged commit 134182f into kubernetes:master Nov 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants