synapsecns/sanguine

View on GitHub

Showing 1,971 of 13,422 total issues

Function testContainer has 5 return statements (exceeds 4 allowed).
Open

func testContainer(ctx context.Context, tb testing.TB) processlog.LogMetadata {
    tb.Helper()

    pool, err := dockertest.NewPool("")
    assert.Nil(tb, err)
Severity: Major
Found in core/dockerutil/docker_test.go - About 35 mins to fix

    Method executionContext.___InputValue_defaultValue has 5 return statements (exceeds 4 allowed).
    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
        }
    Severity: Major
    Found in services/scribe/graphql/server/graph/resolver/server.go - About 35 mins to fix

      Method executionContext.___Type_name has 5 return statements (exceeds 4 allowed).
      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
          }
      Severity: Major
      Found in services/scribe/graphql/server/graph/resolver/server.go - About 35 mins to fix

        Method executionContext.___Type_description has 5 return statements (exceeds 4 allowed).
        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
            }
        Severity: Major
        Found in services/scribe/graphql/server/graph/resolver/server.go - About 35 mins to fix

          Method executionContext.___Type_enumValues has 5 return statements (exceeds 4 allowed).
          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
              }
          Severity: Major
          Found in services/scribe/graphql/server/graph/resolver/server.go - About 35 mins to fix

            Function ValidateOptions has 5 return statements (exceeds 4 allowed).
            Open

            func ValidateOptions(opts ...Option) error {
                logOpts := &logOptions{}
            
                for _, opt := range opts {
                    if err := opt(logOpts); err != nil {
            Severity: Major
            Found in core/dockerutil/options.go - About 35 mins to fix

              Function CopyFile has 5 return statements (exceeds 4 allowed).
              Open

              func CopyFile(src, dest string) error {
                  // Open source file for reading
                  //nolint: gosec
                  srcFile, err := os.Open(src)
                  if err != nil {
              Severity: Major
              Found in core/os.go - About 35 mins to fix

                Method executionContext.___Schema_subscriptionType has 5 return statements (exceeds 4 allowed).
                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
                    }
                Severity: Major
                Found in services/scribe/graphql/server/graph/resolver/server.go - About 35 mins to fix

                  Function GenerateConfig has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring.
                  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)
                      }
                  Severity: Minor
                  Found in services/scribe/config/generate.go - About 35 mins 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 RunEnumExample has 5 return statements (exceeds 4 allowed).
                  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 {
                  Severity: Major
                  Found in core/dbcommon/enum_test.go - About 35 mins to fix

                    Function WithBackoff has 5 return statements (exceeds 4 allowed).
                    Open

                    func WithBackoff(ctx context.Context, doFunc RetryableFunc, configurators ...WithBackoffConfigurator) error {
                        config := defaultConfig()
                    
                        for _, configurator := range configurators {
                            configurator(&config)
                    Severity: Major
                    Found in core/retry/retry.go - About 35 mins to fix

                      Method executionContext.___InputValue_description has 5 return statements (exceeds 4 allowed).
                      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
                          }
                      Severity: Major
                      Found in services/scribe/graphql/server/graph/resolver/server.go - About 35 mins to fix

                        Method executionContext.___Type_ofType has 5 return statements (exceeds 4 allowed).
                        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
                            }
                        Severity: Major
                        Found in services/scribe/graphql/server/graph/resolver/server.go - About 35 mins to fix

                          Method executionContext.___Type_kind has 5 return statements (exceeds 4 allowed).
                          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
                              }
                          Severity: Major
                          Found in services/scribe/graphql/server/graph/resolver/server.go - About 35 mins to fix

                            Function TailContainerLogs has 5 return statements (exceeds 4 allowed).
                            Open

                            func TailContainerLogs(opts ...Option) error {
                                stdoutReader, stdoutWriter := io.Pipe()
                                stderrReader, stderrWriter := io.Pipe()
                            
                                logOpts := &logOptions{
                            Severity: Major
                            Found in core/dockerutil/docker.go - About 35 mins to fix

                              Function GetConfigDir has 5 return statements (exceeds 4 allowed).
                              Open

                              func GetConfigDir() (string, error) {
                                  configDir := configdir.New(VendorName, AppName+nameSuffix)
                                  file := configDir.QueryFolderContainsFile(readmeName)
                              
                                  if file != nil {
                              Severity: Major
                              Found in core/config/configdir.go - About 35 mins to fix

                                Function ellipsizeString has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                Open

                                export const ellipsizeString = ({ string, limiter = 4, isZeroX = false }) => {
                                  if (limiter === 0) {
                                    return string
                                  } else {
                                    if (isZeroX) {
                                Severity: Minor
                                Found in packages/explorer-ui/utils/ellipsizeString.ts - About 35 mins 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 GetLogoPath has 5 return statements (exceeds 4 allowed).
                                Open

                                func GetLogoPath() (_ string, err error) {
                                    configDir, err := GetConfigDir()
                                    if err != nil {
                                        return "", fmt.Errorf("could not get config dir: %w", err)
                                    }
                                Severity: Major
                                Found in core/config/assets.go - About 35 mins to fix

                                  Function makeOTLPExporter has 5 return statements (exceeds 4 allowed).
                                  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, "")
                                  Severity: Major
                                  Found in core/metrics/otlp.go - About 35 mins to fix

                                    Method stdStreamLogArgs.Validate has 5 return statements (exceeds 4 allowed).
                                    Open

                                    func (s *stdStreamLogArgs) Validate() error {
                                        if s.Ctx == nil {
                                            return errCtxNil
                                        }
                                    
                                    
                                    Severity: Major
                                    Found in core/processlog/options.go - About 35 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language