Lambda-School-Labs/wowo-ios

View on GitHub

Showing 86 of 214 total issues

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

    func testUpdateJob() throws {
        if let EditData = JSONLoader.readFrom(filename: "EditJob") {
            URLProtocolMock.testURLs[BASEURL.appendingPathComponent("jobs/job/\(jobId)")] = EditData
        }
        
Severity: Major
Found in ExpressWash/ExpressWashTests/JobControllerTests.swift and 3 other locations - About 6 hrs to fix
ExpressWash/ExpressWashTests/JobControllerTests.swift on lines 142..185
ExpressWash/ExpressWashTests/JobTests.swift on lines 135..178
ExpressWash/ExpressWashTests/JobTests.swift on lines 180..222

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

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 testEditJob() throws {
        
        if let EditData = JSONLoader.readFrom(filename: "EditJob") {
            URLProtocolMock.testURLs[BASEURL.appendingPathComponent("jobs/job/\(jobId)")] = EditData
        }
Severity: Major
Found in ExpressWash/ExpressWashTests/JobControllerTests.swift and 3 other locations - About 6 hrs to fix
ExpressWash/ExpressWashTests/JobControllerTests.swift on lines 187..229
ExpressWash/ExpressWashTests/JobTests.swift on lines 135..178
ExpressWash/ExpressWashTests/JobTests.swift on lines 180..222

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

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 testUpdateJob() throws {
        if let EditData = JSONLoader.readFrom(filename: "EditJob") {
            URLProtocolMock.testURLs[BASEURL.appendingPathComponent("jobs/job/\(jobId)")] = EditData
        }
        
Severity: Major
Found in ExpressWash/ExpressWashTests/JobTests.swift and 3 other locations - About 6 hrs to fix
ExpressWash/ExpressWashTests/JobControllerTests.swift on lines 142..185
ExpressWash/ExpressWashTests/JobControllerTests.swift on lines 187..229
ExpressWash/ExpressWashTests/JobTests.swift on lines 135..178

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

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 testEditJob() throws {
        
        if let EditData = JSONLoader.readFrom(filename: "EditJob") {
            URLProtocolMock.testURLs[BASEURL.appendingPathComponent("jobs/job/\(jobId)")] = EditData
        }
Severity: Major
Found in ExpressWash/ExpressWashTests/JobTests.swift and 3 other locations - About 6 hrs to fix
ExpressWash/ExpressWashTests/JobControllerTests.swift on lines 142..185
ExpressWash/ExpressWashTests/JobControllerTests.swift on lines 187..229
ExpressWash/ExpressWashTests/JobTests.swift on lines 180..222

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

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

    func testCreateJob() throws {
        let jobRepresentation = JobRepresentation(jobId: jobId, jobLocationLat: jobLocationLat, jobLocationLon: jobLocationLon, washAddress: address, address: address, address2: address2, city: city, state: state, zip: zip, notes: notes, jobType: jobType, completed: completed, paid: paid, scheduled: scheduled, photoBeforeJob: photoBeforeJob, photoAfterJob: photoAfterJob, timeRequested: timeRequested, timeCompleted: timeCompleted, carId: carId, clientId: clientId)
        
        let expect = expectation(description: "Job Created")
        
Severity: Major
Found in ExpressWash/ExpressWashTests/JobTests.swift and 5 other locations - About 6 hrs to fix
ExpressWash/ExpressWashTests/JobControllerTests.swift on lines 62..100
ExpressWash/ExpressWashTests/JobControllerTests.swift on lines 102..140
ExpressWash/ExpressWashTests/JobControllerTests.swift on lines 286..324
ExpressWash/ExpressWashTests/JobTests.swift on lines 95..133
ExpressWash/ExpressWashTests/JobTests.swift on lines 253..291

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

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

    func testCreateJob() throws {
        let jobRepresentation = JobRepresentation(jobId: jobId, jobLocationLat: jobLocationLat, jobLocationLon: jobLocationLon, washAddress: address, address: address, address2: address2, city: city, state: state, zip: zip, notes: notes, jobType: jobType, completed: completed, paid: paid, scheduled: scheduled, photoBeforeJob: photoBeforeJob, photoAfterJob: photoAfterJob, timeRequested: timeRequested, timeCompleted: timeCompleted, carId: carId, clientId: clientId)
        
        let expect = expectation(description: "Job Created")
        
Severity: Major
Found in ExpressWash/ExpressWashTests/JobControllerTests.swift and 5 other locations - About 6 hrs to fix
ExpressWash/ExpressWashTests/JobControllerTests.swift on lines 102..140
ExpressWash/ExpressWashTests/JobControllerTests.swift on lines 286..324
ExpressWash/ExpressWashTests/JobTests.swift on lines 55..93
ExpressWash/ExpressWashTests/JobTests.swift on lines 95..133
ExpressWash/ExpressWashTests/JobTests.swift on lines 253..291

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

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

    func testJobInfo() throws {
        let jobRepresentation = JobRepresentation(jobId: jobId, jobLocationLat: jobLocationLat, jobLocationLon: jobLocationLon, washAddress: address, address: address, address2: address2, city: city, state: state, zip: zip, notes: notes, jobType: jobType, completed: completed, paid: paid, scheduled: scheduled, photoBeforeJob: photoBeforeJob, photoAfterJob: photoAfterJob, timeRequested: timeRequested, timeCompleted: timeCompleted, carId: carId, clientId: clientId)

        let expect = expectation(description: "Job Info Received")

Severity: Major
Found in ExpressWash/ExpressWashTests/JobControllerTests.swift and 5 other locations - About 6 hrs to fix
ExpressWash/ExpressWashTests/JobControllerTests.swift on lines 62..100
ExpressWash/ExpressWashTests/JobControllerTests.swift on lines 102..140
ExpressWash/ExpressWashTests/JobTests.swift on lines 55..93
ExpressWash/ExpressWashTests/JobTests.swift on lines 95..133
ExpressWash/ExpressWashTests/JobTests.swift on lines 253..291

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

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

    func testAddJob() throws {
        let jobRepresentation = JobRepresentation(jobId: jobId, jobLocationLat: jobLocationLat, jobLocationLon: jobLocationLon, washAddress: address, address: address, address2: address2, city: city, state: state, zip: zip, notes: notes, jobType: jobType, completed: completed, paid: paid, scheduled: scheduled, photoBeforeJob: photoBeforeJob, photoAfterJob: photoAfterJob, timeRequested: timeRequested, timeCompleted: timeCompleted, carId: carId, clientId: clientId)
        
        let expect = expectation(description: "Job Added")
        
Severity: Major
Found in ExpressWash/ExpressWashTests/JobControllerTests.swift and 5 other locations - About 6 hrs to fix
ExpressWash/ExpressWashTests/JobControllerTests.swift on lines 62..100
ExpressWash/ExpressWashTests/JobControllerTests.swift on lines 286..324
ExpressWash/ExpressWashTests/JobTests.swift on lines 55..93
ExpressWash/ExpressWashTests/JobTests.swift on lines 95..133
ExpressWash/ExpressWashTests/JobTests.swift on lines 253..291

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

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

    func testJobInfo() throws {
        let jobRepresentation = JobRepresentation(jobId: jobId, jobLocationLat: jobLocationLat, jobLocationLon: jobLocationLon, washAddress: address, address: address, address2: address2, city: city, state: state, zip: zip, notes: notes, jobType: jobType, completed: completed, paid: paid, scheduled: scheduled, photoBeforeJob: photoBeforeJob, photoAfterJob: photoAfterJob, timeRequested: timeRequested, timeCompleted: timeCompleted, carId: carId, clientId: clientId)

        let expect = expectation(description: "Job Info Received")

Severity: Major
Found in ExpressWash/ExpressWashTests/JobTests.swift and 5 other locations - About 6 hrs to fix
ExpressWash/ExpressWashTests/JobControllerTests.swift on lines 62..100
ExpressWash/ExpressWashTests/JobControllerTests.swift on lines 102..140
ExpressWash/ExpressWashTests/JobControllerTests.swift on lines 286..324
ExpressWash/ExpressWashTests/JobTests.swift on lines 55..93
ExpressWash/ExpressWashTests/JobTests.swift on lines 95..133

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

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

    func testAddJob() throws {
        let jobRepresentation = JobRepresentation(jobId: jobId, jobLocationLat: jobLocationLat, jobLocationLon: jobLocationLon, washAddress: address, address: address, address2: address2, city: city, state: state, zip: zip, notes: notes, jobType: jobType, completed: completed, paid: paid, scheduled: scheduled, photoBeforeJob: photoBeforeJob, photoAfterJob: photoAfterJob, timeRequested: timeRequested, timeCompleted: timeCompleted, carId: carId, clientId: clientId)
        
        let expect = expectation(description: "Job Added")
        
Severity: Major
Found in ExpressWash/ExpressWashTests/JobTests.swift and 5 other locations - About 6 hrs to fix
ExpressWash/ExpressWashTests/JobControllerTests.swift on lines 62..100
ExpressWash/ExpressWashTests/JobControllerTests.swift on lines 102..140
ExpressWash/ExpressWashTests/JobControllerTests.swift on lines 286..324
ExpressWash/ExpressWashTests/JobTests.swift on lines 55..93
ExpressWash/ExpressWashTests/JobTests.swift on lines 253..291

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

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 getUserJobs(user: User, completion: @escaping ([JobRepresentation]?, Error?) -> Void) {
        let baseURL = BASEURL.appendingPathComponent(ENDPOINTS.jobsClient.rawValue)
        let getJobsURL = baseURL.appendingPathComponent("\(user.userId)")
        var request = URLRequest(url: getJobsURL)
        request.httpMethod = "GET"
Severity: Major
Found in ExpressWash/ExpressWash/JobController+networking.swift and 1 other location - About 5 hrs to fix
ExpressWash/ExpressWash/JobController+networking.swift on lines 159..198

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

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 getWasherJobs(washer: Washer, completion: @escaping ([JobRepresentation]?, Error?) -> Void) {
        let baseURL = BASEURL.appendingPathComponent(ENDPOINTS.jobsWasher.rawValue)
        let getJobsURL = baseURL.appendingPathComponent("\(washer.washerId)")
        var request = URLRequest(url: getJobsURL)
        request.httpMethod = "GET"
Severity: Major
Found in ExpressWash/ExpressWash/JobController+networking.swift and 1 other location - About 5 hrs to fix
ExpressWash/ExpressWash/JobController+networking.swift on lines 118..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 363.

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

    func testAddCar() throws {

        let carId = 0
        let clientId = 6
        let make = "ford"
Severity: Major
Found in ExpressWash/ExpressWashTests/CarControllerTests.swift and 2 other locations - About 4 hrs to fix
ExpressWash/ExpressWashTests/CarControllerTests.swift on lines 36..78
ExpressWash/ExpressWashTests/CarControllerTests.swift on lines 122..162

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

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

    func testCreateCar() throws {

        let carId = 0
        let clientId = 6
        let make = "ford"
Severity: Major
Found in ExpressWash/ExpressWashTests/CarControllerTests.swift and 2 other locations - About 4 hrs to fix
ExpressWash/ExpressWashTests/CarControllerTests.swift on lines 80..120
ExpressWash/ExpressWashTests/CarControllerTests.swift on lines 122..162

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

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

    func testEditCar() throws {

        let carId = 0
        let clientId = 6
        let make = "ford"
Severity: Major
Found in ExpressWash/ExpressWashTests/CarControllerTests.swift and 2 other locations - About 4 hrs to fix
ExpressWash/ExpressWashTests/CarControllerTests.swift on lines 36..78
ExpressWash/ExpressWashTests/CarControllerTests.swift on lines 80..120

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

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

        SESSION.dataTask(with: request) { (data, response, error) in

            if let error = error {
                print("Error creating job: \(error)")
                completion(nil, error)
Severity: Major
Found in ExpressWash/ExpressWash/JobController+networking.swift and 1 other location - About 4 hrs to fix
ExpressWash/ExpressWash/JobController+networking.swift on lines 82..115

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

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

        SESSION.dataTask(with: request) { (data, response, error) in
            if let error = error {
                print("Error getting job info: \(error)")
                completion(nil, error)
                return
Severity: Major
Found in ExpressWash/ExpressWash/JobController+networking.swift and 1 other location - About 4 hrs to fix
ExpressWash/ExpressWash/JobController+networking.swift on lines 35..71

Duplicated Code

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

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

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

Tuning

This issue has a mass of 264.

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 testDeleteJob() throws {
        if let DeleteData = JSONLoader.readFrom(filename: "DeleteJob") {
            URLProtocolMock.testURLs[BASEURL.appendingPathComponent("jobs/job/\(jobId)")] = DeleteData
        }
        
Severity: Major
Found in ExpressWash/ExpressWashTests/JobControllerTests.swift and 1 other location - About 3 hrs to fix
ExpressWash/ExpressWashTests/JobTests.swift on lines 224..251

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

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 testDeleteJob() throws {
        if let DeleteData = JSONLoader.readFrom(filename: "DeleteJob") {
            URLProtocolMock.testURLs[BASEURL.appendingPathComponent("jobs/job/\(jobId)")] = DeleteData
        }
        
Severity: Major
Found in ExpressWash/ExpressWashTests/JobTests.swift and 1 other location - About 3 hrs to fix
ExpressWash/ExpressWashTests/JobControllerTests.swift on lines 257..284

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

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

extension User {

    @objc(insertObject:inJobsAtIndex:)
    @NSManaged public func insertIntoJobs(_ value: Job, at idx: Int)

Severity: Major
Found in ExpressWash/ExpressWash/User+CoreDataProperties.swift and 2 other locations - About 3 hrs to fix
ExpressWash/ExpressWash/User+CoreDataProperties.swift on lines 84..116
ExpressWash/ExpressWash/Washer+CoreDataProperties.swift on lines 35..67

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

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