filestack/filestack-swift

View on GitHub

Showing 176 of 260 total issues

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

    func testConvertPreservingInputQualityTransformationURL() {
        transformable.add(transform: ConvertTransform()
            .format(.jpg)
            .compress()
            .preserveInputQuality()
Severity: Major
Found in Tests/FilestackSDKTests/TransformableTests.swift and 1 other location - About 1 hr to fix
Tests/FilestackSDKTests/TransformableTests.swift on lines 931..943

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

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

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

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

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

Refactorings

Further Reading

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

    func testASCIIWithReverseTransformationUrl() {
        transformable.add(transform: ASCIITransform().background(.red).foreground(.blue).reverse())

        let expectedUrl = Constants.cdnURL
            .appendingPathComponent("ascii=background:FF0000FF,foreground:0000FFFF,colored:true,reverse:true")
Severity: Major
Found in Tests/FilestackSDKTests/TransformableTests.swift and 1 other location - About 1 hr to fix
Tests/FilestackSDKTests/TransformableTests.swift on lines 239..247

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

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

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

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

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

Refactorings

Further Reading

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

    func testWatermarkTransformationURL() {
        transformable.add(transform: WatermarkTransform(file: "WATERMARK-HANDLE").size(50).position(.top))

        let expectedURL = Constants.cdnURL
            .appendingPathComponent("watermark=file:WATERMARK-HANDLE,size:50,position:[top]")
Severity: Major
Found in Tests/FilestackSDKTests/TransformableTests.swift and 1 other location - About 1 hr to fix
Tests/FilestackSDKTests/TransformableTests.swift on lines 309..317

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

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

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

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

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

Refactorings

Further Reading

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

    func testRotateTransformationURL() {
        transformable.add(transform: RotateTransform(deg: 320).exif(true).background(.white))

        let expectedURL = Constants.cdnURL
            .appendingPathComponent("rotate=deg:320,exif:true,background:FFFFFFFF")
Severity: Major
Found in Tests/FilestackSDKTests/TransformableTests.swift and 1 other location - About 1 hr to fix
Tests/FilestackSDKTests/TransformableTests.swift on lines 359..367

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

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

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

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

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

Refactorings

Further Reading

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

    func testUpscaleTransformationUrl() {
        transformable.add(transform: UpscaleTransform().noise(.low).style(.artwork).noUpscale())

        let expectedUrl = Constants.cdnURL
            .appendingPathComponent("upscale=noise:low,style:artwork,upscale:false")
Severity: Major
Found in Tests/FilestackSDKTests/TransformableTests.swift and 1 other location - About 1 hr to fix
Tests/FilestackSDKTests/TransformableTests.swift on lines 73..81

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

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

    func toArray() -> [String] {
        let ops: [String] = type(of: self).all().compactMap {
            guard contains($0) else {
                return nil
            }
Severity: Major
Found in Sources/FilestackSDK/Public/Enums/TransformPosition.swift and 2 other locations - About 1 hr to fix
Sources/FilestackSDK/Public/Enums/MetadataOptions.swift on lines 84..92
Sources/FilestackSDK/Public/Enums/PolicyCall.swift on lines 60..69

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

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

    func toArray() -> [String] {
        let ops: [String] = type(of: self).all().compactMap {
            guard contains($0) else {
                return nil
            }
Severity: Major
Found in Sources/FilestackSDK/Public/Enums/PolicyCall.swift and 2 other locations - About 1 hr to fix
Sources/FilestackSDK/Public/Enums/MetadataOptions.swift on lines 84..92
Sources/FilestackSDK/Public/Enums/TransformPosition.swift on lines 46..55

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

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

    func toArray() -> [String] {
        let ops: [String] = type(of: self).all().compactMap {
            guard contains($0) else { return nil}

            return $0.stringValue()
Severity: Major
Found in Sources/FilestackSDK/Public/Enums/MetadataOptions.swift and 2 other locations - About 1 hr to fix
Sources/FilestackSDK/Public/Enums/PolicyCall.swift on lines 60..69
Sources/FilestackSDK/Public/Enums/TransformPosition.swift on lines 46..55

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

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

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

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

    func testPolaroidTransformationWithOptionalsURL() {
        transformable.add(transform: PolaroidTransform().rotate(45))

        let expectedURL = Constants.cdnURL
            .appendingPathComponent("polaroid=rotate:45")
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 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