Showing 614 of 901 total issues
Function run
has 124 lines of code (exceeds 50 allowed). Consider refactoring. Open
func run(ctx context.Context, pod, secret, namespace string, werfConfig *config.WerfConfig, containerBackend container_backend.ContainerBackend, giterminismManager giterminism_manager.Interface) error {
projectName := werfConfig.Meta.Project
userExtraAnnotations, err := common.GetUserExtraAnnotations(&commonCmdData)
if err != nil {
Function runGetServiceValues
has a Cognitive Complexity of 42 (exceeds 20 allowed). Consider refactoring. Open
func runGetServiceValues(ctx context.Context, imagesToProcess build.ImagesToProcess) error {
logboek.SetAcceptedLevel(level.Error)
if err := werf.Init(*getAutogeneratedValuedCmdData.TmpDir, *getAutogeneratedValuedCmdData.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 runCleanup
has a Cognitive Complexity of 42 (exceeds 20 allowed). Consider refactoring. Open
func runCleanup(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
Method RepoStagesStorage.GetStagesIDsByDigest
has a Cognitive Complexity of 42 (exceeds 20 allowed). Consider refactoring. Open
func (storage *RepoStagesStorage) GetStagesIDsByDigest(ctx context.Context, _, digest string, opts ...Option) ([]image.StageID, error) {
var res []image.StageID
o := makeOptions(opts...)
if tags, err := storage.DockerRegistry.Tags(ctx, storage.RepoAddress, o.dockerRegistryOptions...); 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"
Further reading
Function runPublish
has 44 return statements (exceeds 4 allowed). 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)
Local
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
type Local struct {
*Base
WorkTreeDir string
GitDir string
Function makeMultitrackSpecsFromResList
has 119 lines of code (exceeds 50 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) {
Method api.getRepoImageByDesc
has a Cognitive Complexity of 41 (exceeds 20 allowed). Consider refactoring. Open
func (api *api) getRepoImageByDesc(ctx context.Context, originalTag string, desc *remote.Descriptor, ref name.Reference) (*image.Info, error) {
referenceParts, err := api.parseReferenceParts(ref.Name())
if err != nil {
return nil, fmt.Errorf("unable to parse reference %q: %w", ref.Name(), 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 generateGitMappings
has a Cognitive Complexity of 41 (exceeds 20 allowed). Consider refactoring. Open
func generateGitMappings(ctx context.Context, metaConfig *config.Meta, imageBaseConfig *config.StapelImageBase, opts CommonImageOptions) ([]*stage.GitMapping, error) {
var gitMappings []*stage.GitMapping
if len(imageBaseConfig.Git.Local) != 0 {
localGitRepo := opts.GiterminismManager.LocalGitRepo()
- 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 plan.go
has 570 lines of code (exceeds 500 allowed). Consider refactoring. Open
package plan
import (
"context"
"fmt"
Function run
has 115 lines of code (exceeds 50 allowed). Consider refactoring. Open
func run(ctx context.Context, imagesToProcess build.ImagesToProcess, tagTemplateList []string, extraLabels map[string]string) error {
if imagesToProcess.WithoutImages {
return nil
}
Method diffParser.handleDiffLine
has 115 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (p *diffParser) handleDiffLine(line string) error {
if debugPatchParser() {
oldState := p.state
fmt.Printf("TRUE_GIT parse diff line: state=%#v line=%#v\n", oldState, line)
defer func() {
Function runMain
has a Cognitive Complexity of 40 (exceeds 20 allowed). Consider refactoring. Open
func runMain(ctx context.Context) error {
global_warnings.PostponeMultiwerfNotUpToDateWarning()
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 run
has a Cognitive Complexity of 40 (exceeds 20 allowed). Consider refactoring. Open
func run(ctx context.Context, containerBackend container_backend.ContainerBackend, giterminismManager giterminism_manager.Interface, commonCmdData common.CmdData, cmdData composeCmdData, dockerComposeCmdName string) error {
var envArray []string
if dockerComposeCmdName != "down" {
imagesToProcess := common.GetImagesToProcess(cmdData.WerfImagesToProcess, *commonCmdData.WithoutImages)
- 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 cleanupManager.cleanupUnusedStages
has a Cognitive Complexity of 40 (exceeds 20 allowed). Consider refactoring. Open
func (m *cleanupManager) cleanupUnusedStages(ctx context.Context) error {
stageDescriptionList := m.stageManager.GetStageDescriptionList(stage_manager.StageDescriptionListOptions{})
stageDescriptionListCount := len(stageDescriptionList)
if err := logboek.Context(ctx).Info().LogProcess("Fetching imports metadata").DoError(func() 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 writePatch
has a Cognitive Complexity of 40 (exceeds 20 allowed). Consider refactoring. Open
func writePatch(ctx context.Context, out io.Writer, gitDir, workTreeCacheDir string, withSubmodules bool, opts PatchOptions) (*PatchDescriptor, error) {
var err error
gitDir, err = filepath.Abs(gitDir)
if 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"
Further reading
Function GetLocalDockerServerStorageCheck
has a Cognitive Complexity of 40 (exceeds 20 allowed). Consider refactoring. Open
func GetLocalDockerServerStorageCheck(ctx context.Context, dockerServerStoragePath string) (*LocalDockerServerStorageCheckResult, error) {
res := &LocalDockerServerStorageCheckResult{}
vu, err := volumeutils.GetVolumeUsageByPath(ctx, dockerServerStoragePath)
if 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"
Further reading
WerfConfig
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
type WerfConfig struct {
Meta *Meta
StapelImages []*StapelImage
ImagesFromDockerfile []*ImageFromDockerfile
Artifacts []*StapelImageArtifact
Function generateRunMounts
has 111 lines of code (exceeds 50 allowed). Consider refactoring. Open
func generateRunMounts(mounts []*instructions.Mount) []string {
var runMounts []string
for _, mount := range mounts {
var options []string
Method diffParser.handleDiffLine
has 38 return statements (exceeds 4 allowed). Open
func (p *diffParser) handleDiffLine(line string) error {
if debugPatchParser() {
oldState := p.state
fmt.Printf("TRUE_GIT parse diff line: state=%#v line=%#v\n", oldState, line)
defer func() {