Showing 44 of 44 total issues
Method FlagSet.Parse
has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring. Open
Open
func (f *FlagSet) Parse(arguments []string) error {
f.parsed = true
f.args = arguments
f.actual = map[string]string{}
f.env = map[string]string{}
- 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 NewCronJob
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func NewCronJob(name, schedule, concurrencyPolicy, restartPolicy,
image string, command []string, env map[string]string, resources Resources, annotations Annotations) *CronJob {
Function NewDeployment
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func NewDeployment(name, image string, command []string, replicas, port int, env map[string]string,
resources Resources) *Deployment {
Method FlagSet.parseOne
has 5 return statements (exceeds 4 allowed). Open
Open
func (f *FlagSet) parseOne() (bool, string, error) {
if len(f.args) == 0 {
return false, "", nil
}
s := f.args[0]
Method Unit.ValidateAll
has 5 return statements (exceeds 4 allowed). Open
Open
func (u *Unit) ValidateAll() error {
if err := u.ValidateKeys(); err != nil {
return err
}
if err := u.ValidateExecStartPre(); err != nil {
exported type ServicePort should have comment or be unexported Open
Open
type ServicePort struct {
- Exclude checks
exported type Unit should have comment or be unexported Open
Open
type Unit struct {
- Exclude checks
2: cannot find package "github.com/cogolabs/fleet2kubes/pkg/kubes" in any of: Open
Open
"github.com/cogolabs/fleet2kubes/pkg/kubes"
- Exclude checks
exported function NewUnitState should have comment or be unexported Open
Open
func NewUnitState(loadState, activeState, subState, mID string) *UnitState {
- Exclude checks
exported method FlagSet.Env should have comment or be unexported Open
Open
func (f *FlagSet) Env() map[string]string {
- Exclude checks
exported function NewUnitFromOptions should have comment or be unexported Open
Open
func NewUnitFromOptions(opts []*unit.UnitOption) *UnitFile {
- Exclude checks
exported method Hash.Short should have comment or be unexported Open
Open
func (h Hash) Short() string {
- Exclude checks
exported method UnitFile.Bytes should have comment or be unexported Open
Open
func (u *UnitFile) Bytes() []byte {
- Exclude checks
exported method Unit.ValidateKeys should have comment or be unexported Open
Open
func (u *Unit) ValidateKeys() error {
- Exclude checks
exported method Unit.ValidateExecStart should have comment or be unexported Open
Open
func (u *Unit) ValidateExecStart() error {
- Exclude checks
exported method Unit.ValidateExecStartPost should have comment or be unexported Open
Open
func (u *Unit) ValidateExecStartPost() error {
- Exclude checks
exported type Deployment should have comment or be unexported Open
Open
type Deployment struct {
- Exclude checks
exported function NewDeployment should have comment or be unexported Open
Open
func NewDeployment(name, image string, command []string, replicas, port int, env map[string]string,
- Exclude checks
exported function NewResources should have comment or be unexported Open
Open
func NewResources(memLimit, cpuLimit, reqMemLimit, reqCPULimit string) Resources {
- Exclude checks
exported type FlagSet should have comment or be unexported Open
Open
type FlagSet struct {
- Exclude checks