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();
- 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 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() {
- 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 conveyor.go
has 707 lines of code (exceeds 500 allowed). Consider refactoring. Open
package build
import (
"bytes"
"context"
File repo_stages_storage.go
has 706 lines of code (exceeds 500 allowed). Consider refactoring. Open
package storage
import (
"context"
"fmt"
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)
}
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 {
- 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 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
- 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 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
- 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 677 lines of code (exceeds 500 allowed). Consider refactoring. Open
package plan
import (
"context"
"fmt"
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)
- 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 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)
- 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 full_dockerfile.go
has 662 lines of code (exceeds 500 allowed). Consider refactoring. Open
package stage
import (
"bytes"
"context"
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)
- 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 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
}
RepoStagesStorage
has 41 methods (exceeds 20 allowed). Consider refactoring. Open
type RepoStagesStorage struct {
RepoAddress string
DockerRegistry docker_registry.Interface
ContainerBackend container_backend.ContainerBackend
}
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",
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{}
- 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
StorageManager
has 40 methods (exceeds 20 allowed). Consider refactoring. Open
type StorageManager struct {
parallel bool
parallelTasksLimit int
ProjectName string
File api.go
has 636 lines of code (exceeds 500 allowed). Consider refactoring. Open
package docker_registry
import (
"context"
"errors"
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)