Showing 8 of 88 total issues
Function point
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
Open
func point(at percent: CGFloat, with elements: [PathElement]) -> CGPoint? {
if percent < 0.0 || percent > 1.0 {
return nil
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function point
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
func point(at percent: CGFloat, with elements: [PathElement]) -> CGPoint? {
if percent < 0.0 || percent > 1.0 {
return nil
}
Function getLength
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
Open
func getLength(with elements: [PathElement]) -> CGFloat {
var firstPointInSubpath: CGPoint?
/// Holds current point on the path (must never be a control point)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getLength
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
func getLength(with elements: [PathElement]) -> CGFloat {
var firstPointInSubpath: CGPoint?
/// Holds current point on the path (must never be a control point)
Function cubicCurvePoint
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func cubicCurvePoint(t: CGFloat, p0: CGPoint, c1: CGPoint, c2: CGPoint, p1: CGPoint) -> CGPoint {
Function cubicCurveValue
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func cubicCurveValue(t: CGFloat, p0: CGFloat, c1: CGFloat, c2: CGFloat, p1: CGFloat) -> CGFloat {
Avoid too many return
statements within this function. Open
Open
return nil
Avoid too many return
statements within this function. Open
Open
return linearPoint(t: t, p0: p0, p1: p1)