PDF-Archiver/PDF-Archiver

View on GitHub

Showing 484 of 484 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

    public static var untaggedURL: URL? {
        get {
            appGroup.object(forKey: Names.untaggedURL.rawValue) as? URL
        }
        set {
Severity: Minor
Found in ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift and 1 other location - About 45 mins to fix
ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 111..118

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

Function sort has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

public func sort<Type: CustomComparable>(_ items: [Type], by sortDescriptors: [NSSortDescriptor]) throws -> [Type] {
    return try items.sorted { (lhs, rhs) -> Bool in
        for sortDescriptor in sortDescriptors {
            if try lhs.isBefore(rhs, sortDescriptor) { return true }
            if try rhs.isBefore(lhs, sortDescriptor) { return false }
Severity: Minor
Found in ArchiveCore/Sources/ArchiveBackend/Helpers/SortDescriptors.swift - 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

Function criticalAndAssert has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

    func criticalAndAssert(_ message: @autoclosure () -> Logger.Message,
                           metadata: @autoclosure () -> Logger.Metadata? = nil,
                           source: @autoclosure () -> String? = nil,
                           file: StaticString = #file,
                           function: StaticString = #function,
Severity: Minor
Found in ArchiveCore/Sources/ArchiveSharedConstants/Logging/Log.swift - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open
    • Open
    • Confirmed
    • Invalid
    • Wontfix
    Cancel

                            guard let item = matrix[prevColumn, row - 1] else { continue }
    Severity: Major
    Found in ArchiveCore/Sources/ArchiveBackend/Search/Array+FuzzyMatch.swift - About 45 mins to fix

      Function createDetails has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open
      • Open
      • Confirmed
      • Invalid
      • Wontfix
      Cancel

          static func createDetails(from item: NSMetadataItem) -> FileChange.Details? {
              // get the document path
              guard let documentPath = item.value(forAttribute: NSMetadataItemURLKey) as? URL else {
                  log.errorAndAssert("Could not parse Metadata URL.")
                  return nil

      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 createAndPost has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open
      • Open
      • Confirmed
      • Invalid
      • Wontfix
      Cancel

          public func createAndPost(title: LocalizedStringKey, message: LocalizedStringKey, primaryButtonTitle: LocalizedStringKey, file: StaticString = #file, function: StaticString = #function, line: UInt = #line) {

        Function handleAttachments has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open
        • Open
        • Confirmed
        • Invalid
        • Wontfix
        Cancel

            private func handleAttachments() {
                do {
                    let url = PathConstants.extensionTempPdfURL
                    let inputItems = (extensionContext?.inputItems as? [NSExtensionItem]) ?? []
                    var success = false
        Severity: Minor
        Found in ShareExtension/ShareViewController.swift - 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

        Avoid deeply nested control flow statements.
        Open
        • Open
        • Confirmed
        • Invalid
        • Wontfix
        Cancel

                                    for observation in (request.results as? [VNRecognizedTextObservation] ?? []) {
                                        guard let candidate = observation.topCandidates(1).first,
                                            !candidate.string.isEmpty else { continue }
                                        thisObservation.append(candidate.string)
                                    }
        Severity: Major
        Found in ArchiveCore/Sources/ArchiveBackend/PDFRendering/PDFProcessing.swift - About 45 mins to fix

          Function log has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open
          • Open
          • Confirmed
          • Invalid
          • Wontfix
          Cancel

              public func log(level: Logger.Level, message: Logger.Message, metadata: Logger.Metadata? = nil, file: String = #file, function: String = #function, line: UInt = #line) {

            Function errorAndAssert has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open
            • Open
            • Confirmed
            • Invalid
            • Wontfix
            Cancel

                func errorAndAssert(_ message: @autoclosure () -> Logger.Message,
                                    metadata: @autoclosure () -> Logger.Metadata? = nil,
                                    source: @autoclosure () -> String? = nil,
                                    file: StaticString = #file,
                                    function: StaticString = #function,
            Severity: Minor
            Found in ArchiveCore/Sources/ArchiveSharedConstants/Logging/Log.swift - About 45 mins to fix

              Similar blocks of code found in 3 locations. Consider refactoring.
              Open
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

              //
              //  FilterItem.swift
              //  
              //
              //  Created by Julian Kahnert on 09.09.20.
              Severity: Major
              Found in ArchiveCore/Sources/ArchiveBackend/Search/FilterItem.swift and 2 other locations - About 40 mins to fix
              ArchiveCore/Sources/ArchiveBackend/Search/FilterItem.swift on lines 1..89
              ArchiveCore/Sources/ArchiveBackend/Search/FilterItem.swift on lines 1..89

              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 3 locations. Consider refactoring.
              Open
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

              //
              //  IAPViewModel.swift
              //  PDFArchiver
              //
              //  Created by Julian Kahnert on 13.11.19.
              Severity: Major
              Found in ArchiveCore/Sources/ArchiveViews/IAPViewModel.swift and 2 other locations - About 40 mins to fix
              ArchiveCore/Sources/ArchiveViews/IAPViewModel.swift on lines 1..98
              ArchiveCore/Sources/ArchiveViews/IAPViewModel.swift on lines 1..98

              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
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

                  public static var lastAppUsagePermitted: Bool {
                      get {
                          appGroup.bool(forKey: Names.lastAppUsagePermitted.rawValue)
                      }
                      set {
              Severity: Major
              Found in ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift and 5 other locations - About 40 mins to fix
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 55..62
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 64..71
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 167..174
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 176..183
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 185..192

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

              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
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

                  public static var documentTagsNotRequired: Bool {
                      get {
                          appGroup.bool(forKey: Names.documentTagsNotRequired.rawValue)
                      }
                      set {
              Severity: Major
              Found in ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift and 5 other locations - About 40 mins to fix
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 55..62
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 64..71
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 73..80
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 167..174
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 185..192

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

              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
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

                  public static var documentSpecificationNotRequired: Bool {
                      get {
                          appGroup.bool(forKey: Names.documentSpecificationNotRequired.rawValue)
                      }
                      set {
              Severity: Major
              Found in ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift and 5 other locations - About 40 mins to fix
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 55..62
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 64..71
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 73..80
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 167..174
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 176..183

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

              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
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

                  public static var tutorialShown: Bool {
                      get {
                          appGroup.bool(forKey: Names.tutorialShown.rawValue)
                      }
                      set {
              Severity: Major
              Found in ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift and 5 other locations - About 40 mins to fix
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 64..71
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 73..80
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 167..174
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 176..183
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 185..192

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

              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
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

                  public static var firstDocumentScanAlertPresented: Bool {
                      get {
                          appGroup.bool(forKey: Names.firstDocumentScanAlertPresented.rawValue)
                      }
                      set {
              Severity: Major
              Found in ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift and 5 other locations - About 40 mins to fix
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 55..62
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 73..80
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 167..174
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 176..183
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 185..192

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

              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
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

                  public static var notSaveDocumentTagsAsPDFMetadata: Bool {
                      get {
                          appGroup.bool(forKey: Names.notSaveDocumentTagsAsPDFMetadata.rawValue)
                      }
                      set {
              Severity: Major
              Found in ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift and 5 other locations - About 40 mins to fix
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 55..62
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 64..71
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 73..80
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 176..183
              ArchiveCore/Sources/ArchiveSharedConstants/UserDefaults.swift on lines 185..192

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

              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
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

                      for pageNumber in 0..<min(document.pageCount, 1) {
                          content += document.page(at: pageNumber)?.string ?? ""
                      }
              Severity: Minor
              Found in ArchiveCore/Tests/ArchiveBackendTests/DateParserTests.swift and 1 other location - About 40 mins to fix
              ArchiveCore/Tests/ArchiveBackendTests/TagParserTests.swift on lines 58..60

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

              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
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

                      fileprivate init(isShown: Binding<Bool>, imageHandler: @escaping ([CIImage]) -> Void) {
                          self.isShown = isShown
                          self.imageHandler = imageHandler
                      }
              ArchiveCore/Sources/ArchiveViews/ScanTab/DocumentCameraView.swift on lines 19..22

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

              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
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

                      for pageNumber in 0..<min(document.pageCount, 10) {
                          content += document.page(at: pageNumber)?.string ?? ""
                      }
              Severity: Minor
              Found in ArchiveCore/Tests/ArchiveBackendTests/TagParserTests.swift and 1 other location - About 40 mins to fix
              ArchiveCore/Tests/ArchiveBackendTests/DateParserTests.swift on lines 146..148

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

              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
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

                  public init(isShown: Binding<Bool>, imageHandler: @escaping ([CIImage]) -> Void) {
                      self.isShown = isShown
                      self.imageHandler = imageHandler
                  }
              ArchiveCore/Sources/ArchiveViews/ScanTab/DocumentCameraView.swift on lines 40..43

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

              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 snapshot has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

                  open class func snapshot(_ name: String, timeWaitingForIdle timeout: TimeInterval = 20) {
                      if timeout > 0 {
                          waitForLoadingIndicatorToDisappear(within: timeout)
                      }
              
              
              Severity: Minor
              Found in UITests iOS/SnapshotHelper.swift - About 35 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function tapped has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

                  func tapped(button: IAPButton, presentationMode: Binding<PresentationMode>) {
              
                      switch button {
                      case .level1:
                          log.info("IAPView - buy: Monthly subscription.")
              Severity: Minor
              Found in ArchiveCore/Sources/ArchiveViews/IAPViewModel.swift - About 35 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

                  public static let tempPdfURL: URL = {
                      let tempImageURL = appGroupContainerURL.appendingPathComponent("TempPDFDocuments")
                      createFolderIfNotExists(tempImageURL, name: "TempPDFDocuments")
                      return tempImageURL
                  }()
              Severity: Minor
              Found in ArchiveCore/Sources/ArchiveSharedConstants/PathConstants.swift and 1 other location - About 35 mins to fix
              ArchiveCore/Sources/ArchiveSharedConstants/PathConstants.swift on lines 19..23

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

              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
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

                  public static let tempImageURL: URL = {
                      let tempImageURL = appGroupContainerURL.appendingPathComponent("TempImages")
                      createFolderIfNotExists(tempImageURL, name: "TempIamges")
                      return tempImageURL
                  }()
              Severity: Minor
              Found in ArchiveCore/Sources/ArchiveSharedConstants/PathConstants.swift and 1 other location - About 35 mins to fix
              ArchiveCore/Sources/ArchiveSharedConstants/PathConstants.swift on lines 25..29

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

              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
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

                          } else if PDFDocument(data: data) != nil {
                              let fileUrl = url.appendingPathComponent(UUID().uuidString).appendingPathExtension("pdf")
                              try data.write(to: fileUrl)
                              return true
                          }
              ArchiveCore/Sources/ArchiveSharedConstants/Extensions/NSItemProvider.swift on lines 37..45

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

              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
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

                          if Image(data: data) != nil {
                              let fileUrl = url.appendingPathComponent(UUID().uuidString).appendingPathExtension("jpeg")
                              try data.write(to: fileUrl)
                              return true
                          } else if PDFDocument(data: data) != nil {
              ArchiveCore/Sources/ArchiveSharedConstants/Extensions/NSItemProvider.swift on lines 41..45

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

              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 3 locations. Consider refactoring.
              Open
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

                      try FileManager.default.copyItem(at: Bundle.billJPGGUrl, to: Self.tempFolder.appendingPathComponent(uuid.uuidString + "-3").appendingPathExtension("jpg"))
              Severity: Minor
              Found in ArchiveCore/Tests/ArchiveBackendTests/PDFProcessingTests.swift and 2 other locations - About 30 mins to fix
              ArchiveCore/Tests/ArchiveBackendTests/PDFProcessingTests.swift on lines 143..143
              ArchiveCore/Tests/ArchiveBackendTests/PDFProcessingTests.swift on lines 144..144

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

              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 3 locations. Consider refactoring.
              Open
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

                      try FileManager.default.copyItem(at: Bundle.billJPGGUrl, to: Self.tempFolder.appendingPathComponent(uuid.uuidString + "-2").appendingPathExtension("jpg"))
              Severity: Minor
              Found in ArchiveCore/Tests/ArchiveBackendTests/PDFProcessingTests.swift and 2 other locations - About 30 mins to fix
              ArchiveCore/Tests/ArchiveBackendTests/PDFProcessingTests.swift on lines 143..143
              ArchiveCore/Tests/ArchiveBackendTests/PDFProcessingTests.swift on lines 145..145

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

              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 3 locations. Consider refactoring.
              Open
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

                      try FileManager.default.copyItem(at: Bundle.billJPGGUrl, to: Self.tempFolder.appendingPathComponent(uuid.uuidString + "-1").appendingPathExtension("jpg"))
              Severity: Minor
              Found in ArchiveCore/Tests/ArchiveBackendTests/PDFProcessingTests.swift and 2 other locations - About 30 mins to fix
              ArchiveCore/Tests/ArchiveBackendTests/PDFProcessingTests.swift on lines 144..144
              ArchiveCore/Tests/ArchiveBackendTests/PDFProcessingTests.swift on lines 145..145

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

              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
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

                      XCTAssertEqual(documents.filter(by: [.tag("tag2")]), [documents[0], documents[1]])
              Severity: Minor
              Found in ArchiveCore/Tests/ArchiveBackendTests/DocumentFilterTests.swift and 1 other location - About 30 mins to fix
              ArchiveCore/Tests/ArchiveBackendTests/DocumentFilterTests.swift on lines 29..29

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

              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
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

                      XCTAssertEqual(documents.filter(by: [.tag("tag3")]), [documents[1], documents[2]])
              Severity: Minor
              Found in ArchiveCore/Tests/ArchiveBackendTests/DocumentFilterTests.swift and 1 other location - About 30 mins to fix
              ArchiveCore/Tests/ArchiveBackendTests/DocumentFilterTests.swift on lines 27..27

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

              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

              Avoid too many return statements within this function.
              Open
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

                      return FileChange.Details(url: documentPath, filename: filename, size: Int(size), downloadStatus: documentStatus)

                Avoid too many return statements within this function.
                Open
                • Open
                • Confirmed
                • Invalid
                • Wontfix
                Cancel

                    return UIImage(cgImage: cgImage).png
                Severity: Major
                Found in ArchiveCore/Tests/ArchiveBackendTests/helper/XCTestCase.swift - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open
                  • Open
                  • Confirmed
                  • Invalid
                  • Wontfix
                  Cancel

                          return (score, matrix)
                  Severity: Major
                  Found in ArchiveCore/Sources/ArchiveBackend/Search/Array+FuzzyMatch.swift - About 30 mins to fix

                    Function renderPdf has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open
                    • Open
                    • Confirmed
                    • Invalid
                    • Wontfix
                    Cancel

                        private static func renderPdf(from observations: [TextObservation]) -> PDFDocument {
                    
                            var pages = [PDFPage]()
                            for observation in observations {
                    
                    
                    Severity: Minor
                    Found in ArchiveCore/Sources/ArchiveBackend/PDFRendering/PDFProcessing.swift - About 25 mins to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function moveContents has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open
                    • Open
                    • Confirmed
                    • Invalid
                    • Wontfix
                    Cancel

                        public func moveContents(of sourceFolder: URL, to destinationFolder: URL) throws {
                            guard directoryExists(at: sourceFolder),
                                  directoryExists(at: destinationFolder) else {
                                preconditionFailure("Source/Destionation is no folder - this should not happen.")
                            }
                    Severity: Minor
                    Found in ArchiveCore/Sources/ArchiveSharedConstants/Extensions/FileManager.swift - About 25 mins to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function startWatching has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open
                    • Open
                    • Confirmed
                    • Invalid
                    • Wontfix
                    Cancel

                        private func startWatching(contentsOf url: URL) throws {
                            let enumerator = FileManager.default.enumerator(at: url,
                                                                            includingPropertiesForKeys: [.creationDateKey, .isDirectoryKey],
                                                                            options: [.skipsHiddenFiles]) { (url, error) -> Bool in
                                // if a folder was deleted during enumeration, there occurs a "no such file" error - we assume that there will be another change triggered

                    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

                    Line should be 120 characters or less: currently 146 characters
                    Open
                    • Open
                    • Confirmed
                    • Invalid
                    • Wontfix
                    Cancel

                            try FileManager.default.createDirectory(at: archiveUrl.appendingPathComponent("2020"), withIntermediateDirectories: true, attributes: nil)

                    Line should be 120 characters or less: currently 127 characters
                    Open
                    • Open
                    • Confirmed
                    • Invalid
                    • Wontfix
                    Cancel

                            let urls = try FileManager.default.contentsOfDirectory(at: newArchiveUrl, includingPropertiesForKeys: nil, options: [])

                    Case statements should vertically align with their enclosing switch statement.
                    Open
                    • Open
                    • Confirmed
                    • Invalid
                    • Wontfix
                    Cancel

                                case .critical:

                    Line should be 120 characters or less: currently 121 characters
                    Open
                    • Open
                    • Confirmed
                    • Invalid
                    • Wontfix
                    Cancel

                                        return AnyView(ScanTabView(viewModel: self.scanViewModel).keyboardShortcut("1", modifiers: .command))

                    Line should be 120 characters or less: currently 141 characters
                    Open
                    • Open
                    • Confirmed
                    • Invalid
                    • Wontfix
                    Cancel

                                        DocumentList(shouldShowDeleteButton: false, currentDocument: $viewModel.currentDocument, documents: $viewModel.documents)

                    Type name should only contain alphanumeric characters: 'DocumentView_Previews'
                    Open
                    • Open
                    • Confirmed
                    • Invalid
                    • Wontfix
                    Cancel

                    struct DocumentView_Previews: PreviewProvider {

                    Line should be 120 characters or less: currently 208 characters
                    Open
                    • Open
                    • Confirmed
                    • Invalid
                    • Wontfix
                    Cancel

                            let appClipURLs = (try? FileManager.default.contentsOfDirectory(at: PathConstants.appClipTempPdfURL, includingPropertiesForKeys: [], options: [.skipsHiddenFiles, .skipsSubdirectoryDescendants])) ?? []

                    Case statements should vertically align with their enclosing switch statement.
                    Open
                    • Open
                    • Confirmed
                    • Invalid
                    • Wontfix
                    Cancel

                                    case .tag:

                    Line should be 120 characters or less: currently 123 characters
                    Open
                    • Open
                    • Confirmed
                    • Invalid
                    • Wontfix
                    Cancel

                            // OOM fix: since we save a reference of the view model in a dict, we have to clean up the pdfDocument on disappear

                    Line should be 120 characters or less: currently 146 characters
                    Open
                    • Open
                    • Confirmed
                    • Invalid
                    • Wontfix
                    Cancel

                            try FileManager.default.createDirectory(at: archiveUrl.appendingPathComponent("2019"), withIntermediateDirectories: true, attributes: nil)

                    Line should be 120 characters or less: currently 131 characters
                    Open
                    • Open
                    • Confirmed
                    • Invalid
                    • Wontfix
                    Cancel

                                let urls = try FileManager.default.contentsOfDirectory(at: newArchiveUrl, includingPropertiesForKeys: nil, options: [])
                    Severity
                    Category