brightdigit/MistKit

View on GitHub
Sources/MistKit/Extensions/Array.swift

Summary

Maintainability
A
0 mins
Test Coverage

Force casts should be avoided
Open

    self = Mirror(reflecting: uuid.uuid).children.map { $0.value as! UInt8 }

forced-type-cast

Avoid using the forced form of the type cast operator (as!) because Swift is not able to determine at compile time if the type conversion will succeed. In the event of an unsuccessful conversion, a runtime error will be triggered. The conditional form of the type cast operator (as?) is safer and should be used when possible.

Preferred

if let movie = item as? Movie {
    print("Movie: '\(movie.name)', dir. \(movie.director)")
}

Not Preferred

let movie = item as! Movie
print("Movie: '\(movie.name)', dir. \(movie.director)")

public declarations should be documented.
Open

public extension Array where Element == UInt8 {

public declarations should be documented.
Open

  init(uuid: UUID) {

There are no issues that match your filters.

Category
Status