Showing 631 of 915 total issues

Function getCommitMessages has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

async function getCommitMessages() {
  const { context } = github;

  const ignoreTitle = core.getInput('ignoreTitle').trim();
  const ignoreDescription = core.getInput('ignoreDescription').trim();
Severity: Minor
Found in .github/actions/get-commit-message/index.js - About 7 hrs to fix

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 diffParser.handleDiffLine has a Cognitive Complexity of 62 (exceeds 20 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() {
Severity: Minor
Found in pkg/true_git/diff_parser.go - About 7 hrs to fix

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 conveyor.go has 707 lines of code (exceeds 500 allowed). Consider refactoring.
Open

package build

import (
    "bytes"
    "context"
Severity: Minor
Found in pkg/build/conveyor.go - About 7 hrs to fix

    File repo_stages_storage.go has 706 lines of code (exceeds 500 allowed). Consider refactoring.
    Open

    package storage
    
    import (
        "context"
        "fmt"
    Severity: Minor
    Found in pkg/storage/repo_stages_storage.go - About 6 hrs to fix

      Function runExport has 195 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func runExport(ctx context.Context, imagesToProcess build.ImagesToProcess) error {
          if err := werf.Init(*commonCmdData.TmpDir, *commonCmdData.HomeDir); err != nil {
              return fmt.Errorf("initialization error: %w", err)
          }
      
      
      Severity: Major
      Found in cmd/werf/bundle/export/export.go - About 6 hrs to fix

        Method api.mutateImageOrIndex has a Cognitive Complexity of 58 (exceeds 20 allowed). Consider refactoring.
        Open

        func (api *api) mutateImageOrIndex(ctx context.Context, imageOrIndex interface{}, mutateManifestConfigFunc func(cfg v1.Config) (v1.Config, error), ref name.Reference, isRefByDigest bool) (interface{}, error) {
            switch i := imageOrIndex.(type) {
            case v1.Image:
                cf, err := i.ConfigFile()
                if err != nil {
        Severity: Minor
        Found in pkg/docker_registry/api.go - About 6 hrs to fix

        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 GetExistingGitPatches has a Cognitive Complexity of 58 (exceeds 20 allowed). Consider refactoring.
        Open

        func GetExistingGitPatches(cacheVersionRoot string) ([]*GitPatchDesc, error) {
            var res []*GitPatchDesc
        
            if _, err := os.Stat(cacheVersionRoot); os.IsNotExist(err) {
                return nil, nil
        Severity: Minor
        Found in pkg/git_repo/gitdata/git_patch.go - About 6 hrs to fix

        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 GetExistingGitArchives has a Cognitive Complexity of 58 (exceeds 20 allowed). Consider refactoring.
        Open

        func GetExistingGitArchives(cacheVersionRoot string) ([]*GitArchiveDesc, error) {
            var res []*GitArchiveDesc
        
            if _, err := os.Stat(cacheVersionRoot); os.IsNotExist(err) {
                return nil, nil
        Severity: Minor
        Found in pkg/git_repo/gitdata/git_archive.go - About 6 hrs to fix

        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 677 lines of code (exceeds 500 allowed). Consider refactoring.
        Open

        package plan
        
        import (
            "context"
            "fmt"
        Severity: Minor
        Found in cmd/werf/plan/plan.go - About 6 hrs to fix

          Method StorageManager.FetchStage has a Cognitive Complexity of 55 (exceeds 20 allowed). Consider refactoring.
          Open

          func (m *StorageManager) FetchStage(ctx context.Context, containerBackend container_backend.ContainerBackend, stg stage.Interface) error {
              logboek.Context(ctx).Debug().LogF("-- StagesManager.FetchStage %s\n", stg.LogDetailedName())
          
              if err := m.LockStageImage(ctx, stg.GetStageImage().Image.Name()); err != nil {
                  return fmt.Errorf("error locking stage image %q: %w", stg.GetStageImage().Image.Name(), err)
          Severity: Minor
          Found in pkg/storage/manager/storage_manager.go - About 6 hrs to fix

          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 doYamlValueSecretV2 has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring.
          Open

          func doYamlValueSecretV2(doFunc func([]byte) ([]byte, error), node *yaml_v3.Node, mode yamlProcessorMode) (*yaml_v3.Node, error) {
              switch node.Kind {
              case yaml_v3.DocumentNode:
                  for pos := 0; pos < len(node.Content); pos += 1 {
                      newValueNode, err := doYamlValueSecretV2(doFunc, deepCopyNode(node.Content[pos]), mode)
          Severity: Minor
          Found in pkg/secret/yaml_encoder.go - About 5 hrs to fix

          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 full_dockerfile.go has 662 lines of code (exceeds 500 allowed). Consider refactoring.
          Open

          package stage
          
          import (
              "bytes"
              "context"
          Severity: Minor
          Found in pkg/build/stage/full_dockerfile.go - About 5 hrs to fix

            Function runPublish has a Cognitive Complexity of 53 (exceeds 20 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)
            Severity: Minor
            Found in cmd/werf/bundle/publish/publish.go - About 5 hrs to fix

            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 RunGCForLocalDockerServer has 168 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func RunGCForLocalDockerServer(ctx context.Context, allowedVolumeUsagePercentage, allowedVolumeUsageMarginPercentage float64, dockerServerStoragePath string, force, dryRun bool) error {
                if dockerServerStoragePath == "" {
                    return nil
                }
            
            
            Severity: Major
            Found in pkg/host_cleaning/local_docker_server.go - About 5 hrs to fix

              RepoStagesStorage has 41 methods (exceeds 20 allowed). Consider refactoring.
              Open

              type RepoStagesStorage struct {
                  RepoAddress      string
                  DockerRegistry   docker_registry.Interface
                  ContainerBackend container_backend.ContainerBackend
              }
              Severity: Minor
              Found in pkg/storage/repo_stages_storage.go - About 5 hrs to fix

                Function NewCmd has 161 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                func NewCmd(ctx context.Context) (*cobra.Command, error) {
                    var namespace string
                    ctx = common.NewContextWithCmdData(ctx, &_commonCmdData)
                    cmd := common.SetCommandContext(ctx, &cobra.Command{
                        Use:          "helm",
                Severity: Major
                Found in cmd/werf/helm/helm.go - About 5 hrs to fix

                  Method commitHistoryScanner.handleExtraStageIDsByLastWithIn has a Cognitive Complexity of 51 (exceeds 20 allowed). Consider refactoring.
                  Open

                  func (s *commitHistoryScanner) handleExtraStageIDsByLastWithIn(ctx context.Context, latestCommitStageIDs map[*object.Commit][]string, latestCommitList []*object.Commit) ([]string, []string, map[string][]string, error) {
                      var latestCommitListByLast []*object.Commit
                      var latestCommitListByIn []*object.Commit
                      stageIDHitCommitList := map[string][]string{}
                  
                  
                  Severity: Minor
                  Found in pkg/cleaning/git_history_based_cleanup/scanner.go - About 5 hrs to fix

                  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

                  StorageManager has 40 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  type StorageManager struct {
                      parallel           bool
                      parallelTasksLimit int
                  
                      ProjectName string
                  Severity: Minor
                  Found in pkg/storage/manager/storage_manager.go - About 5 hrs to fix

                    File api.go has 636 lines of code (exceeds 500 allowed). Consider refactoring.
                    Open

                    package docker_registry
                    
                    import (
                        "context"
                        "errors"
                    Severity: Minor
                    Found in pkg/docker_registry/api.go - About 5 hrs to fix

                      File live.py has 385 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      # -*- coding: utf-8 -*-
                      # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
                      # (c) 2017 Ansible Project
                      # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
                      
                      
                      Severity: Minor
                      Found in pkg/build/builder/ansible/callback/live.py - About 5 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language