Showing 106 of 129 total issues
Method publishRunner.RunE
has a Cognitive Complexity of 62 (exceeds 20 allowed). Consider refactoring. Open
func (p *publishRunner) RunE(cmd *cobra.Command, args []string) error {
apiClient := root.MinepkgAPI
nonInteractive := viper.GetBool("nonInteractive")
tasks := logger.NewTask(3)
- 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 publishRunner.RunE
has 182 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (p *publishRunner) RunE(cmd *cobra.Command, args []string) error {
apiClient := root.MinepkgAPI
nonInteractive := viper.GetBool("nonInteractive")
tasks := logger.NewTask(3)
Method launchRunner.RunE
has a Cognitive Complexity of 53 (exceeds 20 allowed). Consider refactoring. Open
func (l *launchRunner) RunE(cmd *cobra.Command, args []string) error {
var err error
vanillaManifest.Requirements.Minecraft = "*"
vanillaManifest.Requirements.MinepkgCompanion = "none"
- 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 launchRunner.RunE
has 151 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (l *launchRunner) RunE(cmd *cobra.Command, args []string) error {
var err error
vanillaManifest.Requirements.Minecraft = "*"
vanillaManifest.Requirements.MinepkgCompanion = "none"
Method initRunner.RunE
has 141 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (i *initRunner) RunE(cmd *cobra.Command, args []string) error {
if _, err := ioutil.ReadFile("./minepkg.toml"); err == nil && !i.force {
return fmt.Errorf("this directory already contains a minepkg.toml. Use --force to overwrite it")
}
Method Instance.BuildLaunchCmd
has 132 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (i *Instance) BuildLaunchCmd(opts *LaunchOptions) (*exec.Cmd, error) {
// this file tells us how to construct the start command
launchManifest := opts.LaunchManifest
var err error
Method tryRunner.RunE
has 121 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (t *tryRunner) RunE(cmd *cobra.Command, args []string) error {
apiClient := root.MinepkgAPI
nonInteractive := viper.GetBool("nonInteractive")
tempDir, err := ioutil.TempDir("", args[0])
Method TheThing.Launch
has 106 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (t *TheThing) Launch(man *manifest.Manifest) error {
connection := t.Connection
t.State.Status = StatusStarting
if root.authProvider == nil {
Method MinepkgClient.FindRelease
has a Cognitive Complexity of 37 (exceeds 20 allowed). Consider refactoring. Open
func (m *MinepkgClient) FindRelease(ctx context.Context, project string, reqs *RequirementQuery) (*Release, error) {
p := Project{client: m, Name: project}
var wantedMCSemver *semver.Version
if reqs.Minecraft != "*" {
- 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 installRunner.installFromMinepkg
has 99 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (i *installRunner) installFromMinepkg(mods []string) error {
instance := i.instance
apiClient := root.MinepkgAPI
task := logger.NewTask(3)
Method tryRunner.RunE
has a Cognitive Complexity of 36 (exceeds 20 allowed). Consider refactoring. Open
func (t *tryRunner) RunE(cmd *cobra.Command, args []string) error {
apiClient := root.MinepkgAPI
nonInteractive := viper.GetBool("nonInteractive")
tempDir, err := ioutil.TempDir("", args[0])
- 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 bumpRunner.RunE
has 95 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (b *bumpRunner) RunE(cmd *cobra.Command, args []string) error {
instance, err := instances.NewFromWd()
if err != nil {
Method unpublishRunner.RunE
has 92 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (p *unpublishRunner) RunE(cmd *cobra.Command, args []string) error {
apiClient := root.MinepkgAPI
// nonInteractive := viper.GetBool("nonInteractive")
var mID *pkgid.ID
Method Instance.BuildLaunchCmd
has a Cognitive Complexity of 33 (exceeds 20 allowed). Consider refactoring. Open
func (i *Instance) BuildLaunchCmd(opts *LaunchOptions) (*exec.Cmd, error) {
// this file tells us how to construct the start command
launchManifest := opts.LaunchManifest
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 dependenciesInSync
has a Cognitive Complexity of 32 (exceeds 20 allowed). Consider refactoring. Open
func dependenciesInSync(lock *manifest.Lockfile, mani *manifest.Manifest) (bool, error) {
if mani == nil {
return false, fmt.Errorf("manifest is nil")
}
- 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 Connection.ListenForHandshake
has 79 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (c *Connection) ListenForHandshake(ctx context.Context) error {
dataChannelOpen := make(chan struct{})
server := http.Server{Addr: "localhost:20876"}
c.httpServer = &server
Function protoLaunch
has 78 lines of code (exceeds 50 allowed). Consider refactoring. Open
func protoLaunch(pack string) {
log.Println("Launching via protocol: " + pack)
// connect to web client
connection := remote.New()
log.Println("Wait for handshake")
Method Reader.ExtractModpack
has a Cognitive Complexity of 31 (exceeds 20 allowed). Consider refactoring. Open
func (p *Reader) ExtractModpack(dest string) error {
zipReader := p.zipReader
skipPrefixes := []string{}
createdDirs := make(map[string]interface{})
- 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 installRunner.installFromMinepkg
has a Cognitive Complexity of 31 (exceeds 20 allowed). Consider refactoring. Open
func (i *installRunner) installFromMinepkg(mods []string) error {
instance := i.instance
apiClient := root.MinepkgAPI
task := logger.NewTask(3)
- 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 Instance.LinkDependencies
has a Cognitive Complexity of 31 (exceeds 20 allowed). Consider refactoring. Open
func (i *Instance) LinkDependencies() error {
files, err := ioutil.ReadDir(i.ModsDir())
if err != nil {
if os.IsNotExist(err) {
if err := os.MkdirAll(i.ModsDir(), os.ModePerm); err != nil {
- 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"