particledecay/kconf

View on GitHub
cmd/completion.go

Summary

Maintainability
A
35 mins
Test Coverage
F
48%

Showing 1 of 3 total issues

Function getNamespacesFromConfig has 5 return statements (exceeds 4 allowed).
Open

func getNamespacesFromConfig(partial string) (out []string, err error) {
config, _ := kc.GetConfig()
 
// fail if we have no current context
if config.CurrentContext == "" {
Severity: Major
Found in cmd/completion.go - About 35 mins to fix

    Similar blocks of code found in 2 locations. Consider refactoring.
    Wontfix

    func completionBashCmd(command *cobra.Command) *cobra.Command {
    completion := &cobra.Command{
    Use: "bash",
    Short: "Get kconf completions for bash",
    Long: `Generate the bash script for kconf completions`,
    Severity: Minor
    Found in cmd/completion.go and 1 other location - About 45 mins to fix
    cmd/completion.go on lines 66..77

    Similar blocks of code found in 2 locations. Consider refactoring.
    Wontfix

    func completionZshCmd(command *cobra.Command) *cobra.Command {
    completion := &cobra.Command{
    Use: "zsh",
    Short: "Get kconf completions for zsh",
    Long: `Generate the zsh script for kconf completions`,
    Severity: Minor
    Found in cmd/completion.go and 1 other location - About 45 mins to fix
    cmd/completion.go on lines 26..37

    There are no issues that match your filters.

    Category
    Status