Showing 106 of 151 total issues
File trayicon_unix.go
has 2064 lines of code (exceeds 500 allowed). Consider refactoring. Open
// +build !windows
/*
Copyright (C) 2018 Red Hat, Inc.
Method RedHatRegistrator.Register
has a Cognitive Complexity of 60 (exceeds 20 allowed). Consider refactoring. Open
func (registrator *RedHatRegistrator) Register(param *RegistrationParameters) error {
keyringDocsLink := "https://docs.okd.io/latest/minishift/troubleshooting/troubleshooting-misc.html#Remove-password-from-keychain"
if isRegistered, err := registrator.IsRegistered(); !isRegistered && err == nil {
for i := 1; i < 4; i++ {
// request username (disallow empty value)
- 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 start.go
has 677 lines of code (exceeds 500 allowed). Consider refactoring. Open
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Function GenerateZshCompletion
has 159 lines of code (exceeds 50 allowed). Consider refactoring. Open
func GenerateZshCompletion(out io.Writer, cmd *cobra.Command) error {
zsh_initialization := `
__minishift_bash_source() {
alias shopt=':'
alias _expand=_bash_expand
Function serveConnections
has a Cognitive Complexity of 49 (exceeds 20 allowed). Consider refactoring. Open
func serveConnections(listener net.Listener, serverConfig *ssh.ServerConfig) {
for {
nConn, err := listener.Accept()
if err != nil {
glog.Fatal("failed to accept incoming connection", err)
- 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 runStart
has 131 lines of code (exceeds 50 allowed). Consider refactoring. Open
func runStart(cmd *cobra.Command, args []string) {
fmt.Println(fmt.Sprintf("-- Starting profile '%s'", constants.ProfileName))
libMachineClient := libmachine.NewClient(state.InstanceDirs.Home, state.InstanceDirs.Certs)
defer libMachineClient.Close()
Function DownloadOpenShiftReleaseBinary
has 126 lines of code (exceeds 50 allowed). Consider refactoring. Open
func DownloadOpenShiftReleaseBinary(binaryType OpenShiftBinaryType, osType minishiftos.OS, version, outputPath string) error {
client := Client()
ctx := context.Background()
var (
err error
Function preflightChecksBeforeStartingHost
has 119 lines of code (exceeds 50 allowed). Consider refactoring. Open
func preflightChecksBeforeStartingHost() {
if shouldPreflightChecksBeSkipped() {
return
}
driverErrorMessage := "See the 'Setting Up the Virtualization Environment' topic (https://docs.okd.io/latest/minishift/getting-started/setting-up-virtualization-environment.html) for more information"
Function runStart
has a Cognitive Complexity of 39 (exceeds 20 allowed). Consider refactoring. Open
func runStart(cmd *cobra.Command, args []string) {
fmt.Println(fmt.Sprintf("-- Starting profile '%s'", constants.ProfileName))
libMachineClient := libmachine.NewClient(state.InstanceDirs.Home, state.InstanceDirs.Certs)
defer libMachineClient.Close()
- 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 file_passes
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def file_passes(filename, refs, regexs):
try:
f = open(filename, 'r')
except:
return False
- 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 DownloadOpenShiftReleaseBinary
has a Cognitive Complexity of 33 (exceeds 20 allowed). Consider refactoring. Open
func DownloadOpenShiftReleaseBinary(binaryType OpenShiftBinaryType, osType minishiftos.OS, version, outputPath string) error {
client := Client()
ctx := context.Background()
var (
err error
- 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 get_files
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def get_files(extensions):
files = []
if len(args.filenames) > 0:
files = args.filenames
else:
- 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 RedHatRegistrator.Register
has 82 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (registrator *RedHatRegistrator) Register(param *RegistrationParameters) error {
keyringDocsLink := "https://docs.okd.io/latest/minishift/troubleshooting/troubleshooting-misc.html#Remove-password-from-keychain"
if isRegistered, err := registrator.IsRegistered(); !isRegistered && err == nil {
for i := 1; i < 4; i++ {
// request username (disallow empty value)
File start_preflight.go
has 510 lines of code (exceeds 500 allowed). Consider refactoring. Open
/*
Copyright (C) 2017 Red Hat, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
File testdata.go
has 507 lines of code (exceeds 500 allowed). Consider refactoring. Open
/*
Copyright (C) 2017 Red Hat, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Method navigation_menu
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def navigation_menu
navigation = ""
topic_map = YAML.load_file('build/_topic_map.yml')
topic_map["Topics"].each_with_index do |topic, index|
topic_directory = topic["Dir"]
- 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 DownloadOpenShiftReleaseBinary
has 20 return statements (exceeds 4 allowed). Open
func DownloadOpenShiftReleaseBinary(binaryType OpenShiftBinaryType, osType minishiftos.OS, version, outputPath string) error {
client := Client()
ctx := context.Background()
var (
err error
Function compareComponentVersions
has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring. Open
func compareComponentVersions(currentVersion, requiredVersion string, componentName string, versionRange string) error {
if strings.HasPrefix(requiredVersion, ">=") {
currentVersion, err := semver.Make(currentVersion)
if err != nil {
return err
- 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 navigation_menu
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def navigation_menu
navigation = ""
topic_map = YAML.load_file('build/_topic_map.yml')
topic_map["Topics"].each_with_index do |topic, index|
topic_directory = topic["Dir"]
Function compareComponentVersions
has 18 return statements (exceeds 4 allowed). Open
func compareComponentVersions(currentVersion, requiredVersion string, componentName string, versionRange string) error {
if strings.HasPrefix(requiredVersion, ">=") {
currentVersion, err := semver.Make(currentVersion)
if err != nil {
return err