github
233 of 323 new or added lines in 21 files covered. (72.14%)
7 existing lines in 4 files now uncovered.2575 of 2960 relevant lines covered (86.99%)
17461.69 hits per line
1 |
package cmd
|
|
2 |
|
|
3 |
import (
|
|
4 |
"github.com/spf13/cobra"
|
|
5 |
|
|
6 |
"github.com/gabotechs/dep-tree/internal/entropy"
|
|
7 |
) |
|
8 |
|
|
|
func EntropyCmd() *cobra.Command {
|
16✔ |
|
cmd := &cobra.Command{ |
16✔ |
|
Use: "entropy",
|
16✔ |
|
Short: "Renders a force-directed graph in the browser",
|
16✔ |
|
Args: cobra.ExactArgs(1),
|
16✔ |
|
RunE: func(cmd *cobra.Command, args []string) error { |
16✔ |
NEW
|
ctx := cmd.Context() |
× |
NEW
|
entrypoint := args[0]
|
× |
NEW
|
|
× |
NEW
|
cfg, err := loadConfig() |
× |
NEW
|
if err != nil { |
× |
NEW
|
return err
|
× |
NEW
|
} |
× |
NEW
|
parserBuilder, err := makeParserBuilder(entrypoint, cfg) |
× |
NEW
|
if err != nil { |
× |
NEW
|
return err
|
× |
NEW
|
} |
× |
NEW
|
ctx, parser, err := parserBuilder(ctx, entrypoint) |
× |
NEW
|
if err != nil { |
× |
NEW
|
return err
|
× |
NEW
|
} |
× |
NEW
|
ctx, err = entropy.Render(ctx, parser) |
× |
NEW
|
return err
|
× |
32 |
}, |
|
33 |
} |
|
34 |
|
|
|
return cmd
|
16✔ |
36 |
} |