Showing 64 of 74 total issues
Function SolutionActionList
has 65 lines of code (exceeds 50 allowed). Consider refactoring. Open
func SolutionActionList(writer io.Writer, tuneApp *app.App) {
jsolutionList := []system.JSolListEntry{}
jsolutionListEntry := system.JSolListEntry{}
setColor := false
fmt.Fprintf(writer, "\nAll solutions (* denotes enabled solution, O denotes override file exists for solution, C denotes custom solutions, D denotes deprecated solutions):\n")
Function PrintStageFields
has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring. Open
func PrintStageFields(writer io.Writer, stageName string, comparison map[string]stageComparison) {
workFile := stgFiles.StageAttributes[stageName]["wfilename"]
headWork := fmt.Sprintf("Version %s (%s) ", txtparser.GetINIFileVersionSectionEntry(workFile, "version"), txtparser.GetINIFileVersionSectionEntry(workFile, "date"))
headStage := fmt.Sprintf("Version %s (%s) ", stgFiles.StageAttributes[stageName]["version"], stgFiles.StageAttributes[stageName]["date"])
- 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 printSolAnalysis
has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring. Open
func printSolAnalysis(writer io.Writer, stageName, txtPrefix, flag string) (bool, int) {
releaseable := true
retVal := 0
txtDeleteSol := "Deletion of %s\n"
txtSolNew := txtPrefix + "Solution is new, no action required.\n"
- 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 GetFLInfo
has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring. Open
func GetFLInfo() (string, string, bool) {
lat := 0
maxlat := 0
supported := false
savedStates := ""
- 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 CheckRpmVers
has 14 return statements (exceeds 4 allowed). Open
func CheckRpmVers(vers1, vers2 string) int {
// per definition numbers are greater than alphas
if vers1 == vers2 {
return 0
}
Function OptServiceVal
has 57 lines of code (exceeds 50 allowed). Consider refactoring. Open
func OptServiceVal(key, cfgval string) string {
ssState := false
edState := false
retVal := ""
serviceKey := key
Function printSolAnalysis
has 57 lines of code (exceeds 50 allowed). Consider refactoring. Open
func printSolAnalysis(writer io.Writer, stageName, txtPrefix, flag string) (bool, int) {
releaseable := true
retVal := 0
txtDeleteSol := "Deletion of %s\n"
txtSolNew := txtPrefix + "Solution is new, no action required.\n"
Function GetSysSearchParam
has 57 lines of code (exceeds 50 allowed). Consider refactoring. Open
func GetSysSearchParam(syskey string) (string, string) {
searchParam := ""
sect := ""
// blkdev
sched := regexp.MustCompile(`block.*queue\.scheduler$`)
Function compareStageFields
has 56 lines of code (exceeds 50 allowed). Consider refactoring. Open
func compareStageFields(sName string, stage, work map[string]string) (allMatch bool, comparisons map[string]stageComparison) {
comparisons = make(map[string]stageComparison)
allMatch = true
// check for deleted Notes
if stgFiles.StageAttributes[sName]["deleted"] == "true" {
Function CollectBlockDeviceInfo
has 55 lines of code (exceeds 50 allowed). Consider refactoring. Open
func CollectBlockDeviceInfo() []string {
bdevConf := BlockDev{
AllBlockDevs: make([]string, 0, 64),
BlockAttributes: make(map[string]map[string]string),
}
Function WrapTxt
has 54 lines of code (exceeds 50 allowed). Consider refactoring. Open
func WrapTxt(text string, width int) (folded []string) {
var words []string
fallback := false
if strings.Contains(text, " ") {
Function CheckRpmVers
has 54 lines of code (exceeds 50 allowed). Consider refactoring. Open
func CheckRpmVers(vers1, vers2 string) int {
// per definition numbers are greater than alphas
if vers1 == vers2 {
return 0
}
Method App.TuneNote
has 53 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (app *App) TuneNote(noteID string) error {
savConf := false
aNote, err := app.GetNoteByID(noteID)
if err != nil {
return err
Function printNoteAnalysis
has 53 lines of code (exceeds 50 allowed). Consider refactoring. Open
func printNoteAnalysis(writer io.Writer, stageName, txtPrefix, flag string) (bool, int) {
releaseable := true
retVal := 0
txtDeleteNote := "Deletion of %s\n"
txtOverrideExists := txtPrefix + "Override file exists and might need adjustments.\n"
Function readVersionSection
has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring. Confirmed
func readVersionSection(fileName string) ([]string, bool, error) {
skipSection := false
staging := false
chkVersEntries := map[string]bool{"missing": false, "found": false, "isNew": false, "isOld": false, "skip": false, "mandVers": false, "mandDate": false, "mandDesc": false, "mandRefs": false}
vsection := []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 WrapTxt
has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring. Open
func WrapTxt(text string, width int) (folded []string) {
var words []string
fallback := false
if strings.Contains(text, " ") {
- 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 getValidBlockDevices
has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring. Open
func getValidBlockDevices() (valDevs []string) {
var isMpath = regexp.MustCompile(`^mpath-\w+`)
var isLVM = regexp.MustCompile(`^LVM-\w+`)
candidates := []string{}
excludedevs := []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 GetFLInfo
has 52 lines of code (exceeds 50 allowed). Consider refactoring. Open
func GetFLInfo() (string, string, bool) {
lat := 0
maxlat := 0
supported := false
savedStates := ""
Function OptBlkVal
has 51 lines of code (exceeds 50 allowed). Consider refactoring. Open
func OptBlkVal(key, cfgval string, cur *param.BlockDeviceQueue, bOK map[string][]string) (string, string) {
info := ""
if cfgval == "" {
return cfgval, info
}
Function GetTuningOptions
has 51 lines of code (exceeds 50 allowed). Consider refactoring. Open
func GetTuningOptions(saptuneTuningDir, thirdPartyTuningDir string) TuningOptions {
ret := TuningOptions{}
// Collect those defined by saptune
_, files := system.ListDir(saptuneTuningDir, "saptune tuning definitions")
for _, fileName := range files {