brennobemoura/request-dl

View on GitHub

Showing 49 of 56 total issues

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

        private func encodeMillisecondsSince1970(_ date: Date, in encoder: URLEncoder.Encoder) throws {
            var container = encoder.valueContainer()
            try container.encode("\(Int64(date.timeIntervalSince1970) * 1_000)")
        }
Sources/RequestDL/Properties/Sources/URL/Query/Models/Strategies/URLEncoder.ArrayEncodingStrategy.swift on lines 42..45
Sources/RequestDL/Properties/Sources/URL/Query/Models/Strategies/URLEncoder.ArrayEncodingStrategy.swift on lines 47..50
Sources/RequestDL/Properties/Sources/URL/Query/Models/Strategies/URLEncoder.ArrayEncodingStrategy.swift on lines 52..55
Sources/RequestDL/Properties/Sources/URL/Query/Models/Strategies/URLEncoder.DateEncodingStrategy.swift on lines 51..54
Sources/RequestDL/Properties/Sources/URL/Query/Models/Strategies/URLEncoder.DictionaryEncodingStrategy.swift on lines 38..41
Sources/RequestDL/Properties/Sources/URL/Query/Models/Strategies/URLEncoder.DictionaryEncodingStrategy.swift on lines 43..46

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

        private func encodeAccessMember(_ key: String, in encoder: URLEncoder.Encoder) throws {
            var container = encoder.keyContainer()
            try container.encode(".\(key)")
        }
Sources/RequestDL/Properties/Sources/URL/Query/Models/Strategies/URLEncoder.ArrayEncodingStrategy.swift on lines 42..45
Sources/RequestDL/Properties/Sources/URL/Query/Models/Strategies/URLEncoder.ArrayEncodingStrategy.swift on lines 47..50
Sources/RequestDL/Properties/Sources/URL/Query/Models/Strategies/URLEncoder.ArrayEncodingStrategy.swift on lines 52..55
Sources/RequestDL/Properties/Sources/URL/Query/Models/Strategies/URLEncoder.DateEncodingStrategy.swift on lines 51..54
Sources/RequestDL/Properties/Sources/URL/Query/Models/Strategies/URLEncoder.DateEncodingStrategy.swift on lines 56..59
Sources/RequestDL/Properties/Sources/URL/Query/Models/Strategies/URLEncoder.DictionaryEncodingStrategy.swift on lines 38..41

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

        private func encodeAccessMember(_ index: Int, in encoder: URLEncoder.Encoder) throws {
           var container = encoder.keyContainer()
           try container.encode(".\(index)")
       }
Sources/RequestDL/Properties/Sources/URL/Query/Models/Strategies/URLEncoder.ArrayEncodingStrategy.swift on lines 42..45
Sources/RequestDL/Properties/Sources/URL/Query/Models/Strategies/URLEncoder.ArrayEncodingStrategy.swift on lines 47..50
Sources/RequestDL/Properties/Sources/URL/Query/Models/Strategies/URLEncoder.DateEncodingStrategy.swift on lines 51..54
Sources/RequestDL/Properties/Sources/URL/Query/Models/Strategies/URLEncoder.DateEncodingStrategy.swift on lines 56..59
Sources/RequestDL/Properties/Sources/URL/Query/Models/Strategies/URLEncoder.DictionaryEncodingStrategy.swift on lines 38..41
Sources/RequestDL/Properties/Sources/URL/Query/Models/Strategies/URLEncoder.DictionaryEncodingStrategy.swift on lines 43..46

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

/*
 See LICENSE for this package's licensing information.
*/

import Foundation
Sources/RequestDL/Properties/Sources/Secure Connection/Certificate/Models/CertificateNode.swift on lines 1..47
Sources/RequestDL/Properties/Sources/Secure Connection/Certificate/Models/CertificateNode.swift on lines 1..47

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 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

    public static func - (lhs: UnitTime, rhs: UnitTime) -> UnitTime {
        .init(lhs.nanoseconds - rhs.nanoseconds)
    }
Sources/RequestDL/Properties/Sources/Headers/Timeout/Models/UnitTime.swift on lines 147..149

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

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

    public static func + (_ lhs: UnitTime, _ rhs: UnitTime) -> UnitTime {
        .init(lhs.nanoseconds + rhs.nanoseconds)
    }
Sources/RequestDL/Properties/Sources/Headers/Timeout/Models/UnitTime.swift on lines 155..157

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

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

/*
 See LICENSE for this package's licensing information.
*/

import Foundation
Sources/RequestDL/Internals/Sources/Secure Connection/Certificate Chain/Internals.CertificateChain.swift on lines 1..54

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

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

    func allocateBuffer(
        key: String,
        cachedResponse: CachedResponse,
        contentLength: UInt64,
        maximumCapacity: UInt64
Sources/RequestDL/Properties/Sources/Cache/Data Cache/Models/MemoryStorage.swift on lines 109..132

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

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

    mutating func allocateBuffer(
        key: String,
        cachedResponse: CachedResponse,
        contentLength: UInt64,
        maximumCapacity: UInt64
Sources/RequestDL/Properties/Sources/Cache/Data Cache/Models/DiskStorage.swift on lines 253..277

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

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