synapsecns/sanguine

View on GitHub
services/rfq/relayer/relconfig/getters.go

Summary

Maintainability
F
4 days
Test Coverage

Config has 51 methods (exceeds 20 allowed). Consider refactoring.
Open

func (c Config) getChainConfigValue(chainID int, fieldName string) (interface{}, error) {
    chainConfig, ok := c.Chains[chainID]
    if ok {
        value, err := getFieldValue(chainConfig, fieldName)
        if err != nil {
Severity: Major
Found in services/rfq/relayer/relconfig/getters.go - About 7 hrs to fix

    File getters.go has 698 lines of code (exceeds 500 allowed). Consider refactoring.
    Open

    package relconfig
    
    import (
        "fmt"
        "math/big"
    Severity: Minor
    Found in services/rfq/relayer/relconfig/getters.go - About 6 hrs to fix

      Method Config.getChainConfigValue has 6 return statements (exceeds 4 allowed).
      Open

      func (c Config) getChainConfigValue(chainID int, fieldName string) (interface{}, error) {
          chainConfig, ok := c.Chains[chainID]
          if ok {
              value, err := getFieldValue(chainConfig, fieldName)
              if err != nil {
      Severity: Major
      Found in services/rfq/relayer/relconfig/getters.go - About 40 mins to fix

        Method Config.GetMaxRelayAmount has 5 return statements (exceeds 4 allowed).
        Open

        func (c Config) GetMaxRelayAmount(chainID int, addr common.Address) *big.Int {
            chainCfg, ok := c.Chains[chainID]
            if !ok {
                return defaultMaxRelayAmount
            }
        Severity: Major
        Found in services/rfq/relayer/relconfig/getters.go - About 35 mins to fix

          Method Config.GetMaxBalance has 5 return statements (exceeds 4 allowed).
          Open

          func (c Config) GetMaxBalance(chainID int, addr common.Address) *big.Int {
              chainCfg, ok := c.Chains[chainID]
              if !ok {
                  return defaultMaxBalance
              }
          Severity: Major
          Found in services/rfq/relayer/relconfig/getters.go - About 35 mins to fix

            Method Config.GetMinQuoteAmount has 5 return statements (exceeds 4 allowed).
            Open

            func (c Config) GetMinQuoteAmount(chainID int, addr common.Address) *big.Int {
                chainCfg, ok := c.Chains[chainID]
                if !ok {
                    return big.NewInt(defaultMinQuoteAmount)
                }
            Severity: Major
            Found in services/rfq/relayer/relconfig/getters.go - About 35 mins to fix

              Method Config.GetScrollMessageFee has 5 return statements (exceeds 4 allowed).
              Open

              func (c Config) GetScrollMessageFee(chainID int) (value *big.Int, err error) {
                  chainCfg, ok := c.Chains[chainID]
                  if !ok {
                      return value, fmt.Errorf("no chain config for chain %d", chainID)
                  }
              Severity: Major
              Found in services/rfq/relayer/relconfig/getters.go - About 35 mins to fix

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                func (c Config) GetMaxRebalanceAmount(chainID int, addr common.Address) *big.Int {
                    tokenCfg, err := c.getTokenConfigByAddr(chainID, addr.Hex())
                    if err != nil {
                        return defaultMaxRebalanceAmount
                    }
                Severity: Major
                Found in services/rfq/relayer/relconfig/getters.go and 1 other location - About 2 hrs to fix
                services/rfq/relayer/relconfig/getters.go on lines 796..810

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 228.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                func (c Config) GetMinRebalanceAmount(chainID int, addr common.Address) *big.Int {
                    tokenCfg, err := c.getTokenConfigByAddr(chainID, addr.Hex())
                    if err != nil {
                        return defaultMaxRebalanceAmount
                    }
                Severity: Major
                Found in services/rfq/relayer/relconfig/getters.go and 1 other location - About 2 hrs to fix
                services/rfq/relayer/relconfig/getters.go on lines 818..832

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 228.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 5 locations. Consider refactoring.
                Open

                func (c Config) GetL1ScrollMessengerAddress(chainID int) (value common.Address, err error) {
                    chainCfg, ok := c.Chains[chainID]
                    if !ok {
                        return value, fmt.Errorf("no chain config for chain %d", chainID)
                    }
                Severity: Major
                Found in services/rfq/relayer/relconfig/getters.go and 4 other locations - About 1 hr to fix
                services/rfq/relayer/relconfig/getters.go on lines 133..145
                services/rfq/relayer/relconfig/getters.go on lines 148..160
                services/rfq/relayer/relconfig/getters.go on lines 163..175
                services/rfq/relayer/relconfig/getters.go on lines 193..205

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 170.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 5 locations. Consider refactoring.
                Open

                func (c Config) GetSynapseCCTPAddress(chainID int) (value common.Address, err error) {
                    chainCfg, ok := c.Chains[chainID]
                    if !ok {
                        return value, fmt.Errorf("no chain config for chain %d", chainID)
                    }
                Severity: Major
                Found in services/rfq/relayer/relconfig/getters.go and 4 other locations - About 1 hr to fix
                services/rfq/relayer/relconfig/getters.go on lines 148..160
                services/rfq/relayer/relconfig/getters.go on lines 163..175
                services/rfq/relayer/relconfig/getters.go on lines 178..190
                services/rfq/relayer/relconfig/getters.go on lines 193..205

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 170.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 5 locations. Consider refactoring.
                Open

                func (c Config) GetL2GatewayAddress(chainID int) (value common.Address, err error) {
                    chainCfg, ok := c.Chains[chainID]
                    if !ok {
                        return value, fmt.Errorf("no chain config for chain %d", chainID)
                    }
                Severity: Major
                Found in services/rfq/relayer/relconfig/getters.go and 4 other locations - About 1 hr to fix
                services/rfq/relayer/relconfig/getters.go on lines 133..145
                services/rfq/relayer/relconfig/getters.go on lines 148..160
                services/rfq/relayer/relconfig/getters.go on lines 163..175
                services/rfq/relayer/relconfig/getters.go on lines 178..190

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 170.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 5 locations. Consider refactoring.
                Open

                func (c Config) GetTokenMessengerAddress(chainID int) (value common.Address, err error) {
                    chainCfg, ok := c.Chains[chainID]
                    if !ok {
                        return value, fmt.Errorf("no chain config for chain %d", chainID)
                    }
                Severity: Major
                Found in services/rfq/relayer/relconfig/getters.go and 4 other locations - About 1 hr to fix
                services/rfq/relayer/relconfig/getters.go on lines 133..145
                services/rfq/relayer/relconfig/getters.go on lines 163..175
                services/rfq/relayer/relconfig/getters.go on lines 178..190
                services/rfq/relayer/relconfig/getters.go on lines 193..205

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 170.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 5 locations. Consider refactoring.
                Open

                func (c Config) GetL1GatewayAddress(chainID int) (value common.Address, err error) {
                    chainCfg, ok := c.Chains[chainID]
                    if !ok {
                        return value, fmt.Errorf("no chain config for chain %d", chainID)
                    }
                Severity: Major
                Found in services/rfq/relayer/relconfig/getters.go and 4 other locations - About 1 hr to fix
                services/rfq/relayer/relconfig/getters.go on lines 133..145
                services/rfq/relayer/relconfig/getters.go on lines 148..160
                services/rfq/relayer/relconfig/getters.go on lines 178..190
                services/rfq/relayer/relconfig/getters.go on lines 193..205

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 170.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                func (c Config) GetMaintenanceBalancePct(chainID int, tokenAddr string) (float64, error) {
                    tokenConfig, err := c.getTokenConfigByAddr(chainID, tokenAddr)
                    if err != nil {
                        return 0, err
                    }
                Severity: Minor
                Found in services/rfq/relayer/relconfig/getters.go and 1 other location - About 40 mins to fix
                services/rfq/relayer/relconfig/getters.go on lines 649..658

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 110.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                func (c Config) GetInitialBalancePct(chainID int, tokenAddr string) (float64, error) {
                    tokenConfig, err := c.getTokenConfigByAddr(chainID, tokenAddr)
                    if err != nil {
                        return 0, err
                    }
                Severity: Minor
                Found in services/rfq/relayer/relconfig/getters.go and 1 other location - About 40 mins to fix
                services/rfq/relayer/relconfig/getters.go on lines 637..646

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 110.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 10 locations. Consider refactoring.
                Open

                func (c Config) GetDestGasEstimate(chainID int) (value int, err error) {
                    rawValue, err := c.getChainConfigValue(chainID, "DestGasEstimate")
                    if err != nil {
                        return value, err
                    }
                Severity: Major
                Found in services/rfq/relayer/relconfig/getters.go and 9 other locations - About 35 mins to fix
                services/rfq/relayer/relconfig/getters.go on lines 208..219
                services/rfq/relayer/relconfig/getters.go on lines 222..233
                services/rfq/relayer/relconfig/getters.go on lines 236..247
                services/rfq/relayer/relconfig/getters.go on lines 265..276
                services/rfq/relayer/relconfig/getters.go on lines 293..304
                services/rfq/relayer/relconfig/getters.go on lines 307..318
                services/rfq/relayer/relconfig/getters.go on lines 321..332
                services/rfq/relayer/relconfig/getters.go on lines 376..387
                services/rfq/relayer/relconfig/getters.go on lines 504..515

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 104.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 10 locations. Consider refactoring.
                Open

                func (c Config) GetQuotePct(chainID int) (value float64, err error) {
                    rawValue, err := c.getChainConfigValue(chainID, "QuotePct")
                    if err != nil {
                        return value, err
                    }
                Severity: Major
                Found in services/rfq/relayer/relconfig/getters.go and 9 other locations - About 35 mins to fix
                services/rfq/relayer/relconfig/getters.go on lines 208..219
                services/rfq/relayer/relconfig/getters.go on lines 222..233
                services/rfq/relayer/relconfig/getters.go on lines 236..247
                services/rfq/relayer/relconfig/getters.go on lines 265..276
                services/rfq/relayer/relconfig/getters.go on lines 279..290
                services/rfq/relayer/relconfig/getters.go on lines 293..304
                services/rfq/relayer/relconfig/getters.go on lines 307..318
                services/rfq/relayer/relconfig/getters.go on lines 321..332
                services/rfq/relayer/relconfig/getters.go on lines 504..515

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 104.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 10 locations. Consider refactoring.
                Open

                func (c Config) GetFinalityConfirmations(chainID int) (value uint64, err error) {
                    rawValue, err := c.getChainConfigValue(chainID, "FinalityConfirmations")
                    if err != nil {
                        return value, err
                    }
                Severity: Major
                Found in services/rfq/relayer/relconfig/getters.go and 9 other locations - About 35 mins to fix
                services/rfq/relayer/relconfig/getters.go on lines 208..219
                services/rfq/relayer/relconfig/getters.go on lines 236..247
                services/rfq/relayer/relconfig/getters.go on lines 265..276
                services/rfq/relayer/relconfig/getters.go on lines 279..290
                services/rfq/relayer/relconfig/getters.go on lines 293..304
                services/rfq/relayer/relconfig/getters.go on lines 307..318
                services/rfq/relayer/relconfig/getters.go on lines 321..332
                services/rfq/relayer/relconfig/getters.go on lines 376..387
                services/rfq/relayer/relconfig/getters.go on lines 504..515

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 104.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 10 locations. Consider refactoring.
                Open

                func (c Config) GetL1FeeChainID(chainID int) (value uint32, err error) {
                    rawValue, err := c.getChainConfigValue(chainID, "L1FeeChainID")
                    if err != nil {
                        return value, err
                    }
                Severity: Major
                Found in services/rfq/relayer/relconfig/getters.go and 9 other locations - About 35 mins to fix
                services/rfq/relayer/relconfig/getters.go on lines 208..219
                services/rfq/relayer/relconfig/getters.go on lines 222..233
                services/rfq/relayer/relconfig/getters.go on lines 236..247
                services/rfq/relayer/relconfig/getters.go on lines 265..276
                services/rfq/relayer/relconfig/getters.go on lines 279..290
                services/rfq/relayer/relconfig/getters.go on lines 307..318
                services/rfq/relayer/relconfig/getters.go on lines 321..332
                services/rfq/relayer/relconfig/getters.go on lines 376..387
                services/rfq/relayer/relconfig/getters.go on lines 504..515

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 104.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 10 locations. Consider refactoring.
                Open

                func (c Config) GetL1FeeOriginGasEstimate(chainID int) (value int, err error) {
                    rawValue, err := c.getChainConfigValue(chainID, "L1FeeOriginGasEstimate")
                    if err != nil {
                        return value, err
                    }
                Severity: Major
                Found in services/rfq/relayer/relconfig/getters.go and 9 other locations - About 35 mins to fix
                services/rfq/relayer/relconfig/getters.go on lines 208..219
                services/rfq/relayer/relconfig/getters.go on lines 222..233
                services/rfq/relayer/relconfig/getters.go on lines 236..247
                services/rfq/relayer/relconfig/getters.go on lines 265..276
                services/rfq/relayer/relconfig/getters.go on lines 279..290
                services/rfq/relayer/relconfig/getters.go on lines 293..304
                services/rfq/relayer/relconfig/getters.go on lines 321..332
                services/rfq/relayer/relconfig/getters.go on lines 376..387
                services/rfq/relayer/relconfig/getters.go on lines 504..515

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 104.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 10 locations. Consider refactoring.
                Open

                func (c Config) GetNativeToken(chainID int) (value string, err error) {
                    rawValue, err := c.getChainConfigValue(chainID, "NativeToken")
                    if err != nil {
                        return value, err
                    }
                Severity: Major
                Found in services/rfq/relayer/relconfig/getters.go and 9 other locations - About 35 mins to fix
                services/rfq/relayer/relconfig/getters.go on lines 208..219
                services/rfq/relayer/relconfig/getters.go on lines 222..233
                services/rfq/relayer/relconfig/getters.go on lines 265..276
                services/rfq/relayer/relconfig/getters.go on lines 279..290
                services/rfq/relayer/relconfig/getters.go on lines 293..304
                services/rfq/relayer/relconfig/getters.go on lines 307..318
                services/rfq/relayer/relconfig/getters.go on lines 321..332
                services/rfq/relayer/relconfig/getters.go on lines 376..387
                services/rfq/relayer/relconfig/getters.go on lines 504..515

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 104.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 10 locations. Consider refactoring.
                Open

                func (c Config) GetOriginGasEstimate(chainID int) (value int, err error) {
                    rawValue, err := c.getChainConfigValue(chainID, "OriginGasEstimate")
                    if err != nil {
                        return value, err
                    }
                Severity: Major
                Found in services/rfq/relayer/relconfig/getters.go and 9 other locations - About 35 mins to fix
                services/rfq/relayer/relconfig/getters.go on lines 208..219
                services/rfq/relayer/relconfig/getters.go on lines 222..233
                services/rfq/relayer/relconfig/getters.go on lines 236..247
                services/rfq/relayer/relconfig/getters.go on lines 279..290
                services/rfq/relayer/relconfig/getters.go on lines 293..304
                services/rfq/relayer/relconfig/getters.go on lines 307..318
                services/rfq/relayer/relconfig/getters.go on lines 321..332
                services/rfq/relayer/relconfig/getters.go on lines 376..387
                services/rfq/relayer/relconfig/getters.go on lines 504..515

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 104.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 10 locations. Consider refactoring.
                Open

                func (c Config) GetL1FeeDestGasEstimate(chainID int) (value int, err error) {
                    rawValue, err := c.getChainConfigValue(chainID, "L1FeeDestGasEstimate")
                    if err != nil {
                        return value, err
                    }
                Severity: Major
                Found in services/rfq/relayer/relconfig/getters.go and 9 other locations - About 35 mins to fix
                services/rfq/relayer/relconfig/getters.go on lines 208..219
                services/rfq/relayer/relconfig/getters.go on lines 222..233
                services/rfq/relayer/relconfig/getters.go on lines 236..247
                services/rfq/relayer/relconfig/getters.go on lines 265..276
                services/rfq/relayer/relconfig/getters.go on lines 279..290
                services/rfq/relayer/relconfig/getters.go on lines 293..304
                services/rfq/relayer/relconfig/getters.go on lines 307..318
                services/rfq/relayer/relconfig/getters.go on lines 376..387
                services/rfq/relayer/relconfig/getters.go on lines 504..515

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 104.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 10 locations. Consider refactoring.
                Open

                func (c Config) GetRebalanceStartBlock(chainID int) (value uint64, err error) {
                    rawValue, err := c.getChainConfigValue(chainID, "RebalanceStartBlock")
                    if err != nil {
                        return value, err
                    }
                Severity: Major
                Found in services/rfq/relayer/relconfig/getters.go and 9 other locations - About 35 mins to fix
                services/rfq/relayer/relconfig/getters.go on lines 208..219
                services/rfq/relayer/relconfig/getters.go on lines 222..233
                services/rfq/relayer/relconfig/getters.go on lines 236..247
                services/rfq/relayer/relconfig/getters.go on lines 265..276
                services/rfq/relayer/relconfig/getters.go on lines 279..290
                services/rfq/relayer/relconfig/getters.go on lines 293..304
                services/rfq/relayer/relconfig/getters.go on lines 307..318
                services/rfq/relayer/relconfig/getters.go on lines 321..332
                services/rfq/relayer/relconfig/getters.go on lines 376..387

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 104.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 10 locations. Consider refactoring.
                Open

                func (c Config) GetConfirmations(chainID int) (value uint64, err error) {
                    rawValue, err := c.getChainConfigValue(chainID, "Confirmations")
                    if err != nil {
                        return value, err
                    }
                Severity: Major
                Found in services/rfq/relayer/relconfig/getters.go and 9 other locations - About 35 mins to fix
                services/rfq/relayer/relconfig/getters.go on lines 222..233
                services/rfq/relayer/relconfig/getters.go on lines 236..247
                services/rfq/relayer/relconfig/getters.go on lines 265..276
                services/rfq/relayer/relconfig/getters.go on lines 279..290
                services/rfq/relayer/relconfig/getters.go on lines 293..304
                services/rfq/relayer/relconfig/getters.go on lines 307..318
                services/rfq/relayer/relconfig/getters.go on lines 321..332
                services/rfq/relayer/relconfig/getters.go on lines 376..387
                services/rfq/relayer/relconfig/getters.go on lines 504..515

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 104.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                There are no issues that match your filters.

                Category
                Status