philips-software/cogito

View on GitHub

Showing 102 of 119 total issues

Function appState has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

func appState(keyStore: KeyStoreState = initialKeyStoreState,
              createIdentity: CreateIdentityState = initialCreateIdentityState,
              diamond: DiamondState = initialDiamondState,
              telepath: TelepathState = initialTelepathState,
              attestations: AttestationsState = initialAttestationsState,
Severity: Major
Found in workspaces/cogito-ios-app/CogitoTests/AppStateHelper.swift - About 50 mins to fix

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

        computeNumberOfChunks: function (file) {
          const sizeOfLastDataChunk = file.size % 4096
          return Math.floor(file.size / 4096) + (sizeOfLastDataChunk === 0 ? 0 : 1)
        },
    workspaces/demo-app/src/services/file-reader/FileStreamReaderAsync.js on lines 27..30

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

    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

      computeNumberOfChunks (file) {
        const sizeOfLastDataChunk = file.size % 4096
        return Math.floor(file.size / 4096) + (sizeOfLastDataChunk === 0 ? 0 : 1)
      }
    workspaces/demo-app/src/services/file-reader/FileStreamReaderWorkerScript.js on lines 21..24

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

    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

        <ContentGridItem>
          <Centered>
            <Big404>:(</Big404>
            <p>You reached the end of the Internet. There is no way back...</p>
          </Centered>
    Severity: Minor
    Found in workspaces/demo-app/src/pages/404/NoMatch404.js and 1 other location - About 50 mins to fix
    workspaces/demo-app/src/pages/404/NoMatch404.js on lines 19..24

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

    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

        <HeaderGridItem>
          <HeaderBar>
            <Title>Cogito</Title>
            <Subtitle>404</Subtitle>
          </HeaderBar>
    Severity: Minor
    Found in workspaces/demo-app/src/pages/404/NoMatch404.js and 1 other location - About 50 mins to fix
    workspaces/demo-app/src/pages/404/NoMatch404.js on lines 25..30

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

    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

            repeat {
                endIndex = newText.index(endIndex, offsetBy: 1)
                delay += delayStep
                setHeaderTitle(String(newText[..<endIndex]), afterDelay: delay)
            } while endIndex < newText.endIndex
    workspaces/cogito-ios-app/Cogito/Home/SelectedFacetViewController.swift on lines 67..71

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

    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

            javascriptValue.invokeAsync("encrypt", withArguments: [password, options, progress]) {
                (error, encrypted) in
                if let error = error {
                    onComplete(WalletError.EncryptError(message: error.message), nil)
                } else {
    Severity: Minor
    Found in workspaces/ethers-ios/Ethers/Wallet.swift and 1 other location - About 45 mins to fix
    workspaces/ethers-ios/Ethers/Wallet.swift on lines 40..47

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

    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

            javascriptValue.invokeAsync("sign", withArguments: [transaction.asDictionary]) {
                (error, signature) in
                if let error = error {
                    onComplete(WalletError.SignError(message: error.message), nil)
                } else {
    Severity: Minor
    Found in workspaces/ethers-ios/Ethers/Wallet.swift and 1 other location - About 45 mins to fix
    workspaces/ethers-ios/Ethers/Wallet.swift on lines 57..64

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

    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

            repeat {
                endIndex = text.index(endIndex, offsetBy: -1)
                delay += delayStep
                setHeaderTitle(String(text[..<endIndex]), afterDelay: delay)
            } while endIndex > text.startIndex
    workspaces/cogito-ios-app/Cogito/Home/SelectedFacetViewController.swift on lines 75..79

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

    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

    import ReSwift
    
    func attestationsReducer(action: Action, state: AttestationsState?) -> AttestationsState {
        var state = state ?? initialAttestationsState
        switch action {
    workspaces/cogito-ios-app/Cogito/Attestations service/AttestationsReducer.swift on lines 1..40

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

    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

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

        return new Promise((resolve, reject) => {
          provider.send(request, (error, result) => {
            error ? reject(error) : resolve(result)
          })
        })
    Severity: Minor
    Found in workspaces/cogito-web3-provider/source/json-rpc-client.js and 1 other location - About 45 mins to fix
    workspaces/cogito-web3-provider/source/transactions-provider.js on lines 64..68

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

    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

    Function checkParams has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      checkParams (params) {
        let errorMessage
    
        if (!params) {
          errorMessage = '{ file: File, callback: (chunk: Uint8Array) => Void }'
    Severity: Minor
    Found in workspaces/demo-app/src/services/file-reader/FileStreamReader.js - About 45 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

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

        return new Promise((resolve, reject) => {
          provider.send(request, (error, result) => {
            error ? reject(error) : resolve(result)
          })
        })
    Severity: Minor
    Found in workspaces/cogito-web3-provider/source/transactions-provider.js and 1 other location - About 45 mins to fix
    workspaces/cogito-web3-provider/source/json-rpc-client.js on lines 10..14

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

    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

    Function run has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        func run() {
            withOpenIdConfiguration { maybeConfig, error in
                if let config = maybeConfig,
                   let url = self.implicitFlowUrl(openIdConfiguration: config),
                   self.urlOpener.canOpenURL(url) {

    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 checkJsonRpcStructure has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    function checkJsonRpcStructure (structure, isNotification) {
      if (structure.jsonrpc !== '2.0') {
        throw new Error('request is not a JSON-RPC 2.0 object')
      }
      if (isNotification) {
    Severity: Minor
    Found in workspaces/telepath-js/source/json-rpc-channel.js - About 45 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

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

    extension TelepathChannel: Equatable {
        static func == (lhs: TelepathChannel, rhs: TelepathChannel) -> Bool {
            return lhs.connectUrl == rhs.connectUrl
        }
    }
    workspaces/cogito-ios-app/Cogito/Attestations service/AttestationsState.swift on lines 11..15
    workspaces/cogito-ios-app/Cogito/Key store/KeyStoreState.swift on lines 5..9
    workspaces/cogito-ios-app/Cogito/Telepath/JsonRpcId.swift on lines 35..39
    workspaces/cogito-ios-app/Cogito/ValueStore service/ValueStoreState.swift on lines 15..19
    workspaces/cogito-ios-app/CogitoTests/ExampleError.swift on lines 5..9

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

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

    extension ExampleError: Equatable {
        static func == (lhs: ExampleError, rhs: ExampleError) -> Bool {
            return lhs.message == rhs.message
        }
    }
    Severity: Major
    Found in workspaces/cogito-ios-app/CogitoTests/ExampleError.swift and 5 other locations - About 40 mins to fix
    workspaces/cogito-ios-app/Cogito/Attestations service/AttestationsState.swift on lines 11..15
    workspaces/cogito-ios-app/Cogito/Key store/KeyStoreState.swift on lines 5..9
    workspaces/cogito-ios-app/Cogito/Telepath/JsonRpcId.swift on lines 35..39
    workspaces/cogito-ios-app/Cogito/Telepath/TelepathChannel.swift on lines 76..80
    workspaces/cogito-ios-app/Cogito/ValueStore service/ValueStoreState.swift on lines 15..19

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

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

    extension AttestationsState: Equatable {
        static func == (lhs: AttestationsState, rhs: AttestationsState) -> Bool {
            return lhs.open == rhs.open
        }
    }
    workspaces/cogito-ios-app/Cogito/Key store/KeyStoreState.swift on lines 5..9
    workspaces/cogito-ios-app/Cogito/Telepath/JsonRpcId.swift on lines 35..39
    workspaces/cogito-ios-app/Cogito/Telepath/TelepathChannel.swift on lines 76..80
    workspaces/cogito-ios-app/Cogito/ValueStore service/ValueStoreState.swift on lines 15..19
    workspaces/cogito-ios-app/CogitoTests/ExampleError.swift on lines 5..9

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

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

    extension KeyStoreState: Equatable {
        static func == (lhs: KeyStoreState, rhs: KeyStoreState) -> Bool {
            return lhs.keyStore == rhs.keyStore
        }
    }
    Severity: Major
    Found in workspaces/cogito-ios-app/Cogito/Key store/KeyStoreState.swift and 5 other locations - About 40 mins to fix
    workspaces/cogito-ios-app/Cogito/Attestations service/AttestationsState.swift on lines 11..15
    workspaces/cogito-ios-app/Cogito/Telepath/JsonRpcId.swift on lines 35..39
    workspaces/cogito-ios-app/Cogito/Telepath/TelepathChannel.swift on lines 76..80
    workspaces/cogito-ios-app/Cogito/ValueStore service/ValueStoreState.swift on lines 15..19
    workspaces/cogito-ios-app/CogitoTests/ExampleError.swift on lines 5..9

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

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

    extension JsonRpcId: Equatable {
        static func == (lhs: JsonRpcId, rhs: JsonRpcId) -> Bool {
            return lhs.json == rhs.json
        }
    }
    Severity: Major
    Found in workspaces/cogito-ios-app/Cogito/Telepath/JsonRpcId.swift and 5 other locations - About 40 mins to fix
    workspaces/cogito-ios-app/Cogito/Attestations service/AttestationsState.swift on lines 11..15
    workspaces/cogito-ios-app/Cogito/Key store/KeyStoreState.swift on lines 5..9
    workspaces/cogito-ios-app/Cogito/Telepath/TelepathChannel.swift on lines 76..80
    workspaces/cogito-ios-app/Cogito/ValueStore service/ValueStoreState.swift on lines 15..19
    workspaces/cogito-ios-app/CogitoTests/ExampleError.swift on lines 5..9

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

    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

    Severity
    Category
    Status
    Source
    Language