Showing 631 of 915 total issues
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,
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 343 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)
}
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 915 lines of code (exceeds 500 allowed). Consider refactoring. Open
package kube_run
import (
"bytes"
"context"
Function run
has a Cognitive Complexity of 87 (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 cleanup.go
has 886 lines of code (exceeds 500 allowed). Consider refactoring. Open
package cleaning
import (
"context"
"fmt"
Function runRender
has a Cognitive Complexity of 84 (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 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 (
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 runRender
has 264 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)
}
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
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)
Method FullDockerfileStage.dockerfileInstructionDependencies
has a Cognitive Complexity of 64 (exceeds 20 allowed). Consider refactoring. Open
func (s *FullDockerfileStage) dockerfileInstructionDependencies(ctx context.Context, giterminismManager giterminism_manager.Interface, resolvedDockerMetaArgsHash, resolvedDependenciesArgsHash map[string]string, dockerStageID int, cmd interface{}, isOnbuildInstruction, isBaseImageOnbuildInstruction bool) ([]string, []string, error) {
var dependencies []string
var onBuildDependencies []string
resolveValueFunc := func(value string) (string, 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
Method WerfChart.CreateNewBundle
has a Cognitive Complexity of 63 (exceeds 20 allowed). Consider refactoring. Open
func (wc *WerfChart) CreateNewBundle(ctx context.Context, destDir, chartVersion string, vals *values.Options) (*Bundle, error) {
chartPath := filepath.Join(wc.GiterminismManager.ProjectDir(), wc.ChartDir)
chrt, err := loader.LoadDir(chartPath)
if err != nil {
return nil, fmt.Errorf("error loading chart %q: %w", chartPath, 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"