vorteil/direktiv

View on GitHub
pkg/model/resources.go

Summary

Maintainability
A
2 hrs
Test Coverage

Function LoadResource has 62 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func LoadResource(data []byte) (interface{}, error) {
    m := make(map[string]interface{})
    err := yaml.Unmarshal(data, &m)
    if err != nil {
        return nil, fmt.Errorf("%w: %w", ErrNotDirektivAPIResource, err)
Severity: Minor
Found in pkg/model/resources.go - About 1 hr to fix

    Function LoadResource has 13 return statements (exceeds 4 allowed).
    Open

    func LoadResource(data []byte) (interface{}, error) {
        m := make(map[string]interface{})
        err := yaml.Unmarshal(data, &m)
        if err != nil {
            return nil, fmt.Errorf("%w: %w", ErrNotDirektivAPIResource, err)
    Severity: Major
    Found in pkg/model/resources.go - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status