synapsecns/sanguine

View on GitHub
services/explorer/consumer/parser/bridgeparser.go

Summary

Maintainability
F
3 days
Test Coverage

Method BridgeParser.ParseLog has a Cognitive Complexity of 69 (exceeds 20 allowed). Consider refactoring.
Open

func (p *BridgeParser) ParseLog(log ethTypes.Log, chainID uint32) (*model.BridgeEvent, bridgeTypes.EventLog, error) {
    logTopic := log.Topics[0]

    iFace, err := func(log ethTypes.Log) (bridgeTypes.EventLog, error) {
        switch logTopic {
Severity: Minor
Found in services/explorer/consumer/parser/bridgeparser.go - About 1 day 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 BridgeParser.ParseLog has 118 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (p *BridgeParser) ParseLog(log ethTypes.Log, chainID uint32) (*model.BridgeEvent, bridgeTypes.EventLog, error) {
    logTopic := log.Topics[0]

    iFace, err := func(log ethTypes.Log) (bridgeTypes.EventLog, error) {
        switch logTopic {
Severity: Major
Found in services/explorer/consumer/parser/bridgeparser.go - About 3 hrs to fix

    Method BridgeParser.ParseLog has 32 return statements (exceeds 4 allowed).
    Open

    func (p *BridgeParser) ParseLog(log ethTypes.Log, chainID uint32) (*model.BridgeEvent, bridgeTypes.EventLog, error) {
        logTopic := log.Topics[0]
    
        iFace, err := func(log ethTypes.Log) (bridgeTypes.EventLog, error) {
            switch logTopic {
    Severity: Major
    Found in services/explorer/consumer/parser/bridgeparser.go - About 2 hrs to fix

      Function eventToBridgeEvent has 78 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func eventToBridgeEvent(event bridgeTypes.EventLog, chainID uint32) model.BridgeEvent {
          var recipient sql.NullString
      
          if event.GetRecipient() != nil {
              recipient.Valid = true
      Severity: Major
      Found in services/explorer/consumer/parser/bridgeparser.go - About 2 hrs to fix

        Consider simplifying this complex logical expression.
        Open

            if coinGeckoID != "" && !(coinGeckoID == "xjewel" && *timeStamp < 1649030400) && !(coinGeckoID == "synapse-2" && *timeStamp < 1630281600) && !(coinGeckoID == "governance-ohm" && *timeStamp < 1638316800) && !(coinGeckoID == "highstreet" && *timeStamp < 1634263200) {
        Severity: Critical
        Found in services/explorer/consumer/parser/bridgeparser.go - About 1 hr to fix

          Method BridgeParser.MatureLogs has 66 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func (p *BridgeParser) MatureLogs(ctx context.Context, bridgeEvent *model.BridgeEvent, iFace bridgeTypes.EventLog, chainID uint32) (interface{}, error) {
              g, groupCtx := errgroup.WithContext(ctx)
              var err error
              var sender *string
              var timeStamp *uint64
          Severity: Minor
          Found in services/explorer/consumer/parser/bridgeparser.go - About 1 hr to fix

            Method BridgeParser.MatureLogs has 11 return statements (exceeds 4 allowed).
            Open

            func (p *BridgeParser) MatureLogs(ctx context.Context, bridgeEvent *model.BridgeEvent, iFace bridgeTypes.EventLog, chainID uint32) (interface{}, error) {
                g, groupCtx := errgroup.WithContext(ctx)
                var err error
                var sender *string
                var timeStamp *uint64
            Severity: Major
            Found in services/explorer/consumer/parser/bridgeparser.go - About 1 hr to fix

              Method BridgeParser.MatureLogs has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
              Open

              func (p *BridgeParser) MatureLogs(ctx context.Context, bridgeEvent *model.BridgeEvent, iFace bridgeTypes.EventLog, chainID uint32) (interface{}, error) {
                  g, groupCtx := errgroup.WithContext(ctx)
                  var err error
                  var sender *string
                  var timeStamp *uint64
              Severity: Minor
              Found in services/explorer/consumer/parser/bridgeparser.go - About 1 hr 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 NewBridgeParser has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              func NewBridgeParser(consumerDB db.ConsumerDB, bridgeAddress common.Address, tokenDataService tokendata.Service, consumerFetcher fetcher.ScribeFetcher, tokenPriceService tokenprice.Service, fromAPI bool) (*BridgeParser, error) {
              Severity: Minor
              Found in services/explorer/consumer/parser/bridgeparser.go - About 45 mins to fix

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

                func (p *BridgeParser) EventType(log ethTypes.Log) (_ bridgeTypes.EventType, ok bool) {
                    for _, logTopic := range log.Topics {
                        eventType := bridge.EventTypeFromTopic(logTopic)
                        if eventType == nil {
                            continue
                Severity: Major
                Found in services/explorer/consumer/parser/bridgeparser.go and 2 other locations - About 50 mins to fix
                services/explorer/consumer/parser/messagebusparser.go on lines 43..53
                services/explorer/consumer/parser/swapparser.go on lines 96..108

                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 121.

                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 9 locations. Consider refactoring.
                Open

                        case bridge.Topic(bridgeTypes.DepositEvent):
                            iFace, err := p.Filterer.ParseTokenDeposit(log)
                            if err != nil {
                                iFaceV1, err := p.FiltererV1.ParseTokenDeposit(log)
                                if err != nil {
                Severity: Major
                Found in services/explorer/consumer/parser/bridgeparser.go and 8 other locations - About 35 mins to fix
                services/explorer/consumer/parser/bridgeparser.go on lines 241..254
                services/explorer/consumer/parser/bridgeparser.go on lines 255..268
                services/explorer/consumer/parser/bridgeparser.go on lines 269..282
                services/explorer/consumer/parser/bridgeparser.go on lines 283..296
                services/explorer/consumer/parser/bridgeparser.go on lines 297..310
                services/explorer/consumer/parser/bridgeparser.go on lines 311..324
                services/explorer/consumer/parser/bridgeparser.go on lines 325..338
                services/explorer/consumer/parser/bridgeparser.go on lines 339..352

                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 9 locations. Consider refactoring.
                Open

                        case bridge.Topic(bridgeTypes.WithdrawEvent):
                            iFace, err := p.Filterer.ParseTokenWithdraw(log)
                            if err != nil {
                                iFaceV1, err := p.FiltererV1.ParseTokenWithdraw(log)
                                if err != nil {
                Severity: Major
                Found in services/explorer/consumer/parser/bridgeparser.go and 8 other locations - About 35 mins to fix
                services/explorer/consumer/parser/bridgeparser.go on lines 227..240
                services/explorer/consumer/parser/bridgeparser.go on lines 241..254
                services/explorer/consumer/parser/bridgeparser.go on lines 269..282
                services/explorer/consumer/parser/bridgeparser.go on lines 283..296
                services/explorer/consumer/parser/bridgeparser.go on lines 297..310
                services/explorer/consumer/parser/bridgeparser.go on lines 311..324
                services/explorer/consumer/parser/bridgeparser.go on lines 325..338
                services/explorer/consumer/parser/bridgeparser.go on lines 339..352

                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 9 locations. Consider refactoring.
                Open

                        case bridge.Topic(bridgeTypes.RedeemEvent):
                            iFace, err := p.Filterer.ParseTokenRedeem(log)
                            if err != nil {
                                iFaceV1, err := p.FiltererV1.ParseTokenRedeem(log)
                                if err != nil {
                Severity: Major
                Found in services/explorer/consumer/parser/bridgeparser.go and 8 other locations - About 35 mins to fix
                services/explorer/consumer/parser/bridgeparser.go on lines 227..240
                services/explorer/consumer/parser/bridgeparser.go on lines 255..268
                services/explorer/consumer/parser/bridgeparser.go on lines 269..282
                services/explorer/consumer/parser/bridgeparser.go on lines 283..296
                services/explorer/consumer/parser/bridgeparser.go on lines 297..310
                services/explorer/consumer/parser/bridgeparser.go on lines 311..324
                services/explorer/consumer/parser/bridgeparser.go on lines 325..338
                services/explorer/consumer/parser/bridgeparser.go on lines 339..352

                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 9 locations. Consider refactoring.
                Open

                        case bridge.Topic(bridgeTypes.MintAndSwapEvent):
                            iFace, err := p.Filterer.ParseTokenMintAndSwap(log)
                            if err != nil {
                                iFaceV1, err := p.FiltererV1.ParseTokenMintAndSwap(log)
                                if err != nil {
                Severity: Major
                Found in services/explorer/consumer/parser/bridgeparser.go and 8 other locations - About 35 mins to fix
                services/explorer/consumer/parser/bridgeparser.go on lines 227..240
                services/explorer/consumer/parser/bridgeparser.go on lines 241..254
                services/explorer/consumer/parser/bridgeparser.go on lines 255..268
                services/explorer/consumer/parser/bridgeparser.go on lines 269..282
                services/explorer/consumer/parser/bridgeparser.go on lines 283..296
                services/explorer/consumer/parser/bridgeparser.go on lines 311..324
                services/explorer/consumer/parser/bridgeparser.go on lines 325..338
                services/explorer/consumer/parser/bridgeparser.go on lines 339..352

                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 9 locations. Consider refactoring.
                Open

                        case bridge.Topic(bridgeTypes.RedeemAndRemoveEvent):
                            iFace, err := p.Filterer.ParseTokenRedeemAndRemove(log)
                            if err != nil {
                                iFaceV1, err := p.FiltererV1.ParseTokenRedeemAndRemove(log)
                                if err != nil {
                Severity: Major
                Found in services/explorer/consumer/parser/bridgeparser.go and 8 other locations - About 35 mins to fix
                services/explorer/consumer/parser/bridgeparser.go on lines 227..240
                services/explorer/consumer/parser/bridgeparser.go on lines 241..254
                services/explorer/consumer/parser/bridgeparser.go on lines 255..268
                services/explorer/consumer/parser/bridgeparser.go on lines 269..282
                services/explorer/consumer/parser/bridgeparser.go on lines 283..296
                services/explorer/consumer/parser/bridgeparser.go on lines 297..310
                services/explorer/consumer/parser/bridgeparser.go on lines 311..324
                services/explorer/consumer/parser/bridgeparser.go on lines 339..352

                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 9 locations. Consider refactoring.
                Open

                        case bridge.Topic(bridgeTypes.DepositAndSwapEvent):
                            iFace, err := p.Filterer.ParseTokenDepositAndSwap(log)
                            if err != nil {
                                iFaceV1, err := p.FiltererV1.ParseTokenDepositAndSwap(log)
                                if err != nil {
                Severity: Major
                Found in services/explorer/consumer/parser/bridgeparser.go and 8 other locations - About 35 mins to fix
                services/explorer/consumer/parser/bridgeparser.go on lines 227..240
                services/explorer/consumer/parser/bridgeparser.go on lines 241..254
                services/explorer/consumer/parser/bridgeparser.go on lines 255..268
                services/explorer/consumer/parser/bridgeparser.go on lines 269..282
                services/explorer/consumer/parser/bridgeparser.go on lines 297..310
                services/explorer/consumer/parser/bridgeparser.go on lines 311..324
                services/explorer/consumer/parser/bridgeparser.go on lines 325..338
                services/explorer/consumer/parser/bridgeparser.go on lines 339..352

                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 9 locations. Consider refactoring.
                Open

                        case bridge.Topic(bridgeTypes.MintEvent):
                            iFace, err := p.Filterer.ParseTokenMint(log)
                            if err != nil {
                                iFaceV1, err := p.FiltererV1.ParseTokenMint(log)
                                if err != nil {
                Severity: Major
                Found in services/explorer/consumer/parser/bridgeparser.go and 8 other locations - About 35 mins to fix
                services/explorer/consumer/parser/bridgeparser.go on lines 227..240
                services/explorer/consumer/parser/bridgeparser.go on lines 241..254
                services/explorer/consumer/parser/bridgeparser.go on lines 255..268
                services/explorer/consumer/parser/bridgeparser.go on lines 283..296
                services/explorer/consumer/parser/bridgeparser.go on lines 297..310
                services/explorer/consumer/parser/bridgeparser.go on lines 311..324
                services/explorer/consumer/parser/bridgeparser.go on lines 325..338
                services/explorer/consumer/parser/bridgeparser.go on lines 339..352

                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 9 locations. Consider refactoring.
                Open

                        case bridge.Topic(bridgeTypes.RedeemAndSwapEvent):
                            iFace, err := p.Filterer.ParseTokenRedeemAndSwap(log)
                            if err != nil {
                                iFaceV1, err := p.FiltererV1.ParseTokenRedeemAndSwap(log)
                                if err != nil {
                Severity: Major
                Found in services/explorer/consumer/parser/bridgeparser.go and 8 other locations - About 35 mins to fix
                services/explorer/consumer/parser/bridgeparser.go on lines 227..240
                services/explorer/consumer/parser/bridgeparser.go on lines 241..254
                services/explorer/consumer/parser/bridgeparser.go on lines 255..268
                services/explorer/consumer/parser/bridgeparser.go on lines 269..282
                services/explorer/consumer/parser/bridgeparser.go on lines 283..296
                services/explorer/consumer/parser/bridgeparser.go on lines 297..310
                services/explorer/consumer/parser/bridgeparser.go on lines 325..338
                services/explorer/consumer/parser/bridgeparser.go on lines 339..352

                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 9 locations. Consider refactoring.
                Open

                        case bridge.Topic(bridgeTypes.WithdrawAndRemoveEvent):
                            iFace, err := p.Filterer.ParseTokenWithdrawAndRemove(log)
                            if err != nil {
                                iFaceV1, err := p.FiltererV1.ParseTokenWithdrawAndRemove(log)
                                if err != nil {
                Severity: Major
                Found in services/explorer/consumer/parser/bridgeparser.go and 8 other locations - About 35 mins to fix
                services/explorer/consumer/parser/bridgeparser.go on lines 227..240
                services/explorer/consumer/parser/bridgeparser.go on lines 241..254
                services/explorer/consumer/parser/bridgeparser.go on lines 255..268
                services/explorer/consumer/parser/bridgeparser.go on lines 269..282
                services/explorer/consumer/parser/bridgeparser.go on lines 283..296
                services/explorer/consumer/parser/bridgeparser.go on lines 297..310
                services/explorer/consumer/parser/bridgeparser.go on lines 311..324
                services/explorer/consumer/parser/bridgeparser.go on lines 325..338

                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