Showing 614 of 901 total issues
Function runRender
has a Cognitive Complexity of 147 (exceeds 20 allowed). Consider refactoring. Open
func runRender(ctx context.Context, imagesToProcess build.ImagesToProcess) error {
if err := werf.Init(*commonCmdData.TmpDir, *commonCmdData.HomeDir); err != nil {
return fmt.Errorf("initialization error: %w", err)
}
- 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 setNewDocs
has 476 lines of code (exceeds 50 allowed). Consider refactoring. Open
func setNewDocs(cmd *cobra.Command) {
switch cmd.Use {
case "events [--for TYPE/NAME] [--watch]":
cmd.Annotations = map[string]string{
common.DocsLongMD: GetAlphaEventsDocs().LongMD,
Function runRender
has 437 lines of code (exceeds 50 allowed). Consider refactoring. Open
func runRender(ctx context.Context, imagesToProcess build.ImagesToProcess) error {
if err := werf.Init(*commonCmdData.TmpDir, *commonCmdData.HomeDir); err != nil {
return fmt.Errorf("initialization error: %w", err)
}
File native_linux.go
has 1006 lines of code (exceeds 500 allowed). Consider refactoring. Open
//go:build linux
// +build linux
package buildah
File map.go
has 974 lines of code (exceeds 500 allowed). Consider refactoring. Open
package slug
var mapping = map[string]string{
"0": "0",
"1": "1",
Function run
has 341 lines of code (exceeds 50 allowed). Consider refactoring. Open
func run(ctx context.Context, containerBackend container_backend.ContainerBackend, giterminismManager giterminism_manager.Interface, imagesToProcess build.ImagesToProcess) error {
werfConfigPath, werfConfig, err := common.GetRequiredWerfConfig(ctx, &commonCmdData, giterminismManager, common.GetWerfConfigOptions(&commonCmdData, true))
if err != nil {
return fmt.Errorf("unable to load werf config: %w", err)
}
Function run
has a Cognitive Complexity of 93 (exceeds 20 allowed). Consider refactoring. Open
func run(ctx context.Context, containerBackend container_backend.ContainerBackend, giterminismManager giterminism_manager.Interface, imagesToProcess build.ImagesToProcess) error {
werfConfigPath, werfConfig, err := common.GetRequiredWerfConfig(ctx, &commonCmdData, giterminismManager, common.GetWerfConfigOptions(&commonCmdData, true))
if err != nil {
return fmt.Errorf("unable to load werf config: %w", err)
}
- 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
File kubectl_docs.go
has 930 lines of code (exceeds 500 allowed). Consider refactoring. Open
package kubectl
import (
"fmt"
"path"
File kube_run.go
has 914 lines of code (exceeds 500 allowed). Consider refactoring. Open
package kube_run
import (
"bytes"
"context"
File cleanup.go
has 879 lines of code (exceeds 500 allowed). Consider refactoring. Open
package cleaning
import (
"context"
"fmt"
Function makeMultitrackSpecsFromResList
has a Cognitive Complexity of 82 (exceeds 20 allowed). Consider refactoring. Open
func makeMultitrackSpecsFromResList(ctx context.Context, resources helm_kube.ResourceList, timeout, statusProgressPeriod time.Duration) (*multitrack.MultitrackSpecs, error) {
specs := &multitrack.MultitrackSpecs{}
for _, v := range resources {
switch value := asVersioned(v).(type) {
- 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
File storage_manager.go
has 851 lines of code (exceeds 500 allowed). Consider refactoring. Open
package manager
import (
"context"
"errors"
File static.go
has 841 lines of code (exceeds 500 allowed). Consider refactoring. Open
// Code generated by "esc -no-compress -ignore static.go -o ansible/static.go -pkg ansible ansible"; DO NOT EDIT.
package ansible
import (
Function runRender
has 276 lines of code (exceeds 50 allowed). Consider refactoring. Open
func runRender(ctx context.Context) error {
if err := werf.Init(*commonCmdData.TmpDir, *commonCmdData.HomeDir); err != nil {
return fmt.Errorf("initialization error: %w", err)
}
Method ExtraAnnotationsAndLabelsPostRenderer.Run
has a Cognitive Complexity of 78 (exceeds 20 allowed). Consider refactoring. Open
func (pr *ExtraAnnotationsAndLabelsPostRenderer) Run(renderedManifests *bytes.Buffer) (*bytes.Buffer, error) {
extraAnnotations := map[string]string{}
for k, v := range WerfRuntimeAnnotations {
extraAnnotations[k] = v
}
- 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 prepareMultitrackSpec
has a Cognitive Complexity of 75 (exceeds 20 allowed). Consider refactoring. Open
func prepareMultitrackSpec(metadataName, resourceNameOrKind, namespace string, annotations map[string]string, failuresCountOptions allowedFailuresCountOptions) (*multitrack.MultitrackSpec, error) {
defaultAllowFailuresCount := new(int)
// Allow 1 fail per replica by default
*defaultAllowFailuresCount = applyAllowedFailuresCountMultiplier(failuresCountOptions.defaultPerReplica, failuresCountOptions.multiplier)
- 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 generateRunMounts
has a Cognitive Complexity of 74 (exceeds 20 allowed). Consider refactoring. Open
func generateRunMounts(mounts []*instructions.Mount) []string {
var runMounts []string
for _, mount := range mounts {
var options []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 runRender
has a Cognitive Complexity of 70 (exceeds 20 allowed). Consider refactoring. Open
func runRender(ctx context.Context) error {
if err := werf.Init(*commonCmdData.TmpDir, *commonCmdData.HomeDir); err != nil {
return fmt.Errorf("initialization error: %w", err)
}
- 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
Conveyor
has 59 methods (exceeds 20 allowed). Consider refactoring. Open
type Conveyor struct {
werfConfig *config.WerfConfig
projectDir string
containerWerfDir string
Function runPublish
has 226 lines of code (exceeds 50 allowed). Consider refactoring. Open
func runPublish(ctx context.Context, imagesToProcess build.ImagesToProcess) error {
global_warnings.PostponeMultiwerfNotUpToDateWarning()
if err := werf.Init(*commonCmdData.TmpDir, *commonCmdData.HomeDir); err != nil {
return fmt.Errorf("initialization error: %w", err)