Showing 1,971 of 13,422 total issues
Function testContainer
has 5 return statements (exceeds 4 allowed). Open
Open
func testContainer(ctx context.Context, tb testing.TB) processlog.LogMetadata {
tb.Helper()
pool, err := dockertest.NewPool("")
assert.Nil(tb, err)
Method executionContext.___InputValue_defaultValue
has 5 return statements (exceeds 4 allowed). Open
Open
func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field)
if err != nil {
return graphql.Null
}
Method executionContext.___Type_name
has 5 return statements (exceeds 4 allowed). Open
Open
func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
fc, err := ec.fieldContext___Type_name(ctx, field)
if err != nil {
return graphql.Null
}
Method executionContext.___Type_description
has 5 return statements (exceeds 4 allowed). Open
Open
func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
fc, err := ec.fieldContext___Type_description(ctx, field)
if err != nil {
return graphql.Null
}
Method executionContext.___Type_enumValues
has 5 return statements (exceeds 4 allowed). Open
Open
func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
fc, err := ec.fieldContext___Type_enumValues(ctx, field)
if err != nil {
return graphql.Null
}
Function ValidateOptions
has 5 return statements (exceeds 4 allowed). Open
Open
func ValidateOptions(opts ...Option) error {
logOpts := &logOptions{}
for _, opt := range opts {
if err := opt(logOpts); err != nil {
Function CopyFile
has 5 return statements (exceeds 4 allowed). Open
Open
func CopyFile(src, dest string) error {
// Open source file for reading
//nolint: gosec
srcFile, err := os.Open(src)
if err != nil {
Method executionContext.___Schema_subscriptionType
has 5 return statements (exceeds 4 allowed). Open
Open
func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field)
if err != nil {
return graphql.Null
}
Function GenerateConfig
has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring. Open
Open
func GenerateConfig(ctx context.Context, omniRPCUrl, deployPath string, outputPath string, skippedChainIDS []int, cg ClientGenerator) error {
contracts, err := hardhat.GetDeployments(deployPath)
if err != nil {
return fmt.Errorf("could not get deployments: %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 RunEnumExample
has 5 return statements (exceeds 4 allowed). Open
Open
func RunEnumExample(ctx context.Context, dbDir string) (res []InventoryModel, err error) {
gdb, err := gorm.Open(sqlite.Open(dbDir), &gorm.Config{
Logger: dbcommon.GetGormLogger(testDBLogger),
})
if err != nil {
Function WithBackoff
has 5 return statements (exceeds 4 allowed). Open
Open
func WithBackoff(ctx context.Context, doFunc RetryableFunc, configurators ...WithBackoffConfigurator) error {
config := defaultConfig()
for _, configurator := range configurators {
configurator(&config)
Method executionContext.___InputValue_description
has 5 return statements (exceeds 4 allowed). Open
Open
func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
fc, err := ec.fieldContext___InputValue_description(ctx, field)
if err != nil {
return graphql.Null
}
Method executionContext.___Type_ofType
has 5 return statements (exceeds 4 allowed). Open
Open
func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
fc, err := ec.fieldContext___Type_ofType(ctx, field)
if err != nil {
return graphql.Null
}
Method executionContext.___Type_kind
has 5 return statements (exceeds 4 allowed). Open
Open
func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
fc, err := ec.fieldContext___Type_kind(ctx, field)
if err != nil {
return graphql.Null
}
Function TailContainerLogs
has 5 return statements (exceeds 4 allowed). Open
Open
func TailContainerLogs(opts ...Option) error {
stdoutReader, stdoutWriter := io.Pipe()
stderrReader, stderrWriter := io.Pipe()
logOpts := &logOptions{
Function GetConfigDir
has 5 return statements (exceeds 4 allowed). Open
Open
func GetConfigDir() (string, error) {
configDir := configdir.New(VendorName, AppName+nameSuffix)
file := configDir.QueryFolderContainsFile(readmeName)
if file != nil {
Function ellipsizeString
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
export const ellipsizeString = ({ string, limiter = 4, isZeroX = false }) => {
if (limiter === 0) {
return string
} else {
if (isZeroX) {
- 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 GetLogoPath
has 5 return statements (exceeds 4 allowed). Open
Open
func GetLogoPath() (_ string, err error) {
configDir, err := GetConfigDir()
if err != nil {
return "", fmt.Errorf("could not get config dir: %w", err)
}
Function makeOTLPExporter
has 5 return statements (exceeds 4 allowed). Open
Open
func makeOTLPExporter(ctx context.Context, envSuffix string) (*otlptrace.Exporter, error) {
transport := transportFromString(getEnvSuffix(otelTransportEnv, envSuffix, otlpTransportGRPC.String()))
url := getEnvSuffix(otelEndpointEnv, envSuffix, "")
secure := core.GetEnvBool(makeEnv(otelInsecureEvn, envSuffix), false)
headers := getEnvSuffix(otelHeadersEnv, envSuffix, "")
Method stdStreamLogArgs.Validate
has 5 return statements (exceeds 4 allowed). Open
Open
func (s *stdStreamLogArgs) Validate() error {
if s.Ctx == nil {
return errCtxNil
}