filestack/filestack-swift

View on GitHub

Showing 260 of 260 total issues

Function testGetContentWithParametersAndSecurity has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    func testGetContentWithParametersAndSecurity() {
        stub(condition: cdnStubConditions) { _ in
            HTTPStubsResponse(data: Data(), statusCode: 200, headers: nil)
        }

Severity: Minor
Found in Tests/FilestackSDKTests/FileLinkTests.swift - About 1 hr to fix

    Function enqueue has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        func enqueue(operations: [SubmitPartUploadOperation]) {
            var partsAndEtags: [Int: String] = [:]
    
            var completeCount = 0
    
    

      Function uploadDataChunk has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          func uploadDataChunk(using response: JSONResponse) {
              guard !isCancelled else { return }
      
              if let apiErrorDescription = error(from: response) {
                  finish(with: .failure(.api(apiErrorDescription)))

        Function testUploadFileAtTemporaryLocation has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            func testUploadFileAtTemporaryLocation() {
                var hitCount = 0
        
                stubRegularMultipartRequest(hitCount: &hitCount)
        
        
        Severity: Minor
        Found in Tests/FilestackSDKTests/UploadTests.swift - About 1 hr to fix

          Function testRegularMultiPartUpload has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              func testRegularMultiPartUpload() {
                  var hitCount = 0
          
                  stubRegularMultipartRequest(hitCount: &hitCount)
          
          
          Severity: Minor
          Found in Tests/FilestackSDKTests/UploadTests.swift - About 1 hr to fix

            Function uploadDataChunk has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                func uploadDataChunk(using response: JSONResponse) {
                    guard !isCancelled else { return }
            
                    if let apiErrorDescription = error(from: response) {
                        finish(with: .failure(.api(apiErrorDescription)))

              Function testAudioConvertTransformationURL has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  func testAudioConvertTransformationURL() {
                      transformable
                          .add(transform: AVTransform()
                              .preset("m4a")
                              .force(false)
              Severity: Minor
              Found in Tests/FilestackSDKTests/TransformableTests.swift - About 1 hr to fix

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

                    func testShadowTransformationWithOptionalsURL() {
                        transformable.add(transform: ShadowTransform().blur(15).opacity(20))
                
                        let expectedURL = Constants.cdnURL
                            .appendingPathComponent("shadow=blur:15,opacity:20")
                Severity: Major
                Found in Tests/FilestackSDKTests/TransformableTests.swift and 3 other locations - About 1 hr to fix
                Tests/FilestackSDKTests/TransformableTests.swift on lines 219..227
                Tests/FilestackSDKTests/TransformableTests.swift on lines 1457..1469
                Tests/FilestackSDKTests/TransformableTests.swift on lines 1622..1632

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

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

                    func testProgressiveJPEGTransformationUrl() {
                        transformable.add(transform: ProgressiveJPEGTransform().quality(15).metadata(true))
                
                        let expectedUrl = Constants.cdnURL
                            .appendingPathComponent("pjpg=quality:15,metadata:true")
                Severity: Major
                Found in Tests/FilestackSDKTests/TransformableTests.swift and 3 other locations - About 1 hr to fix
                Tests/FilestackSDKTests/TransformableTests.swift on lines 756..764
                Tests/FilestackSDKTests/TransformableTests.swift on lines 1457..1469
                Tests/FilestackSDKTests/TransformableTests.swift on lines 1622..1632

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

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

                    func testMinifyCSSTransformationWithOptionsURL() {
                        transformable.add(transform: MinifyCSSTransform()
                            .level(1)
                            .gzip(true))
                
                
                Severity: Major
                Found in Tests/FilestackSDKTests/TransformableTests.swift and 3 other locations - About 1 hr to fix
                Tests/FilestackSDKTests/TransformableTests.swift on lines 219..227
                Tests/FilestackSDKTests/TransformableTests.swift on lines 756..764
                Tests/FilestackSDKTests/TransformableTests.swift on lines 1457..1469

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

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

                    func testDocumentDetectionTransformationURL() {
                        transformable.add(transform: DocumentDetectionTransform()
                            .coords(false)
                            .preprocess(true))
                
                
                Severity: Major
                Found in Tests/FilestackSDKTests/TransformableTests.swift and 3 other locations - About 1 hr to fix
                Tests/FilestackSDKTests/TransformableTests.swift on lines 219..227
                Tests/FilestackSDKTests/TransformableTests.swift on lines 756..764
                Tests/FilestackSDKTests/TransformableTests.swift on lines 1622..1632

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

                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 multiPartUpload has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public func multiPartUpload(from localURL: URL,
                                                storeOptions: StorageOptions = StorageOptions(location: .s3, access: .private),
                                                useIntelligentIngestionIfAvailable: Bool = true,
                                                queue: DispatchQueue = .main,
                                                startUploadImmediately: Bool = true,
                Severity: Major
                Found in Sources/FilestackSDK/Public/Extensions/Client+Deprecated.swift - About 50 mins to fix

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

                      public func multiFileUpload(from localURLs: [URL],
                                                  storeOptions: StorageOptions = StorageOptions(location: .s3, access: .private),
                                                  useIntelligentIngestionIfAvailable: Bool = true,
                                                  queue: DispatchQueue = .main,
                                                  startUploadImmediately: Bool = true,
                  Severity: Major
                  Found in Sources/FilestackSDK/Public/Extensions/Client+Deprecated.swift - About 50 mins to fix

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

                        func testCompressTransformationUrl() {
                            transformable.add(transform: CompressTransform().metadata(true))
                    
                            let expectedUrl = Constants.cdnURL
                                .appendingPathComponent("compress=metadata:true")
                    Severity: Major
                    Found in Tests/FilestackSDKTests/TransformableTests.swift and 10 other locations - About 50 mins to fix
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 83..91
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 93..101
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 185..193
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 661..669
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 691..699
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 806..814
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 816..824
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 836..844
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 866..874
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 886..894

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

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

                        func testSharpenTransformationURL() {
                            transformable.add(transform: SharpenTransform().amount(3))
                    
                            let expectedURL = Constants.cdnURL
                                .appendingPathComponent("sharpen=amount:3")
                    Severity: Major
                    Found in Tests/FilestackSDKTests/TransformableTests.swift and 10 other locations - About 50 mins to fix
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 83..91
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 93..101
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 134..142
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 185..193
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 661..669
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 691..699
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 806..814
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 836..844
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 866..874
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 886..894

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

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

                        func testBlurTransformationURL() {
                            transformable.add(transform: BlurTransform().amount(5))
                    
                            let expectedURL = Constants.cdnURL
                                .appendingPathComponent("blur=amount:5")
                    Severity: Major
                    Found in Tests/FilestackSDKTests/TransformableTests.swift and 10 other locations - About 50 mins to fix
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 83..91
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 93..101
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 134..142
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 185..193
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 661..669
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 691..699
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 806..814
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 816..824
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 866..874
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 886..894

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

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

                        func testBlurFacesTransformationUrl() {
                            transformable.add(transform: BlurFacesTransform().amount(30))
                    
                            let expectedUrl = Constants.cdnURL
                                .appendingPathComponent("blur_faces=amount:30.0")
                    Severity: Major
                    Found in Tests/FilestackSDKTests/TransformableTests.swift and 10 other locations - About 50 mins to fix
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 93..101
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 134..142
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 185..193
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 661..669
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 691..699
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 806..814
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 816..824
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 836..844
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 866..874
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 886..894

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

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

                        func testBorderTransformationWithOptionalsURL() {
                            transformable.add(transform: BorderTransform().width(5))
                    
                            let expectedURL = Constants.cdnURL
                                .appendingPathComponent("border=width:5")
                    Severity: Major
                    Found in Tests/FilestackSDKTests/TransformableTests.swift and 10 other locations - About 50 mins to fix
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 83..91
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 93..101
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 134..142
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 185..193
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 661..669
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 691..699
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 816..824
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 836..844
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 866..874
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 886..894

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

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

                        func testOilPaintTransformationUrl() {
                            transformable.add(transform: OilPaintTransform().amount(13))
                    
                            let expectedUrl = Constants.cdnURL
                                .appendingPathComponent("oil_paint=amount:13")
                    Severity: Major
                    Found in Tests/FilestackSDKTests/TransformableTests.swift and 10 other locations - About 50 mins to fix
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 83..91
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 93..101
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 134..142
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 661..669
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 691..699
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 806..814
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 816..824
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 836..844
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 866..874
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 886..894

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

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

                        func testVignetteTransformationWithOptionalsURL() {
                            transformable.add(transform: VignetteTransform().amount(35))
                    
                            let expectedURL = Constants.cdnURL
                                .appendingPathComponent("vignette=amount:35")
                    Severity: Major
                    Found in Tests/FilestackSDKTests/TransformableTests.swift and 10 other locations - About 50 mins to fix
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 83..91
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 93..101
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 134..142
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 185..193
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 691..699
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 806..814
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 816..824
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 836..844
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 866..874
                    Tests/FilestackSDKTests/TransformableTests.swift on lines 886..894

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

                    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