This document records methods that intentionally exceed the current cyclomatic complexity review threshold.
- Review threshold: cyclomatic complexity greater than 10.
- Risk threshold: CRAP score greater than 30 requires immediate test hardening or refactoring.
- Current status: the fresh coverage/CRAP report generated on 2026-06-08 has no methods above CRAP 30 and the instrumented packages are at 100% line, branch, and method coverage.
- Source report:
tests/FixedMathSharp.Tests/TestResults/coverage-analysis/reports/Summary.txt.
Complexity exceptions are acceptable when the method is a hot deterministic math path, a direct component-wise value comparison, a fixed-shape assertion helper, or an algorithm where extraction would add indirection without reducing real maintenance risk. These exceptions should be revisited when coverage drops, behavior changes, or the implementation becomes harder to reason about.
| Module | Method | Complexity | Coverage | Rationale | Revisit if |
|---|---|---|---|---|---|
FixedMathSharp.FluentAssertions |
FixedAssertionHelpers.AreComponentApproximatelyEqual(Fixed4x4, Fixed4x4, Fixed64) |
30 | 100% line / 100% branch | Fixed-shape assertion over all matrix components. The explicit checks keep assertion intent clear and avoid allocations in test helpers. | Assertion diagnostics degrade, matrix shape changes, or repeated assertion logic grows further. |
FixedMathSharp |
Fixed4x4.Equals(Fixed4x4) |
30 | 100% line / 100% branch | Direct 4x4 value comparison avoids loops, allocations, and indexer overhead on a hot value type. | Equality semantics change or a generated/source-shared component comparison becomes available without runtime cost. |
FixedMathSharp |
FixedBoundSphere.CreateFromPointSpan(ReadOnlySpan<Vector3d>) |
24 | 100% line / 100% branch | Ritter-style bounding sphere construction has fixed selection and expansion branches; keeping it span-based preserves the allocation-free path. | More sphere construction modes are added, coverage drops, or the algorithm needs accuracy/performance tuning. |
FixedMathSharp |
FixedBoundSphere.CreateFromPointList(IReadOnlyList<Vector3d>) |
24 | 100% line / 100% branch | Ritter-style bounding sphere construction has fixed selection and expansion branches; keeping it local preserves data flow and avoids extra passes. | More sphere construction modes are added, coverage drops, or the algorithm needs accuracy/performance tuning. |
FixedMathSharp |
FixedMath.Sin(Fixed64) |
24 | 100% line / 100% branch | Trigonometric range reduction and approximation are performance-sensitive and deterministic. Extraction would split a compact numeric routine. | Approximation strategy changes or benchmark evidence shows a helper split is neutral or faster. |
FixedMathSharp |
Fixed64.op_Division(Fixed64, Fixed64) |
24 | 100% line / 100% branch | Saturating fixed-point division uses low-level bit operations and guarded overflow paths that should remain explicit. | Division semantics change or additional edge cases make the method difficult to audit. |
FixedMathSharp |
FixedBoundSphere.CreateFromFrustumCorners(FixedBoundFrustum) |
22 | 100% line / 100% branch | Frustum-corner sphere construction mirrors the point-list algorithm while avoiding a temporary public collection. | Frustum corner ordering changes or the sphere construction algorithm is replaced. |
FixedMathSharp |
FixedMath.FastDiv(Fixed64, Fixed64) |
22 | 100% line / 100% branch | Expert fast division keeps overflow and sign handling explicit in a deterministic arithmetic hot path. | Division invariants change or benchmarks support a simpler guarded implementation. |
FixedMathSharp |
FixedQuaternion.TryFormat(...) |
18 | 100% line / 100% branch | Span formatting has fixed delimiter and component-write branches that avoid intermediate strings. | Formatting shape changes or a shared zero-allocation formatter becomes available. |
FixedMathSharp |
Fixed4x4.TryFormat(...) |
18 | 100% line / 100% branch | Matrix span formatting writes a fixed 4x4 shape without temporary strings. | Formatting shape changes or a shared zero-allocation formatter becomes available. |
FixedMathSharp |
Vector4d.TryFormat(...) |
18 | 100% line / 100% branch | Vector span formatting writes a fixed component shape without temporary strings. | Formatting shape changes or a shared zero-allocation formatter becomes available. |
FixedMathSharp |
FixedMath.Sqrt(Fixed64) |
18 | 100% line / 100% branch | Integer square-root logic is branchy by nature and sits on a core deterministic math path. | A simpler algorithm is adopted with equal determinism and performance. |
FixedMathSharp |
Fixed3x3Extensions.FuzzyEqual(Fixed3x3, Fixed3x3, Fixed64?) |
18 | 100% line / 100% branch | Component-wise fuzzy equality is intentionally explicit to avoid allocation and preserve inlining. | The matrix equality helpers are generated or centralized without adding runtime overhead. |
FixedMathSharp |
FixedBoundSphere.ContainsBoxLike(Vector3d, Vector3d) |
18 | 100% line / 100% branch | Checks all box-like corners against the sphere; explicit shape avoids temporary corner arrays. | Bounds internals move to a shared corner iterator that is allocation-free. |
FixedMathSharp |
FixedMath.Atan(Fixed64) |
18 | 100% line / 100% branch | Trigonometric approximation and range handling are deterministic hot-path math. | Approximation strategy changes or benchmark evidence supports decomposition. |
FixedMathSharp |
Fixed4x4.get_Item(int) |
17 | 100% line / 100% branch | Switch-based fixed matrix indexing is direct and avoids table allocation or reflection. | The matrix layout changes or generated indexer code becomes part of the build. |
FixedMathSharp |
Fixed4x4.set_Item(int, Fixed64) |
17 | 100% line / 100% branch | Switch-based fixed matrix indexing is direct and avoids table allocation or reflection. | The matrix layout changes or generated indexer code becomes part of the build. |
FixedMathSharp.FluentAssertions |
FixedAssertionHelpers.AreComponentApproximatelyEqual(Fixed3x3, Fixed3x3, Fixed64) |
16 | 100% line / 100% branch | Fixed-shape assertion over all matrix components keeps helper behavior direct and allocation-free. | Assertion diagnostics degrade, matrix shape changes, or repeated assertion logic grows further. |
FixedMathSharp |
Fixed3x3Extensions.FuzzyEqualAbsolute(Fixed3x3, Fixed3x3, Fixed64) |
16 | 100% line / 100% branch | Direct component-wise comparison avoids loops and keeps the extension inlinable. | The matrix equality helpers are generated or centralized without adding runtime overhead. |
FixedMathSharp |
Fixed3x3.Equals(Fixed3x3) |
16 | 100% line / 100% branch | Direct 3x3 value comparison avoids loops, allocations, and indexer overhead on a hot value type. | Equality semantics change or a generated/source-shared component comparison becomes available without runtime cost. |
FixedMathSharp |
FixedMath.Asin(Fixed64) |
16 | 100% line / 100% branch | Trigonometric domain handling and approximation are deterministic hot-path math. | Approximation strategy changes or benchmark evidence supports decomposition. |
FixedMathSharp |
FixedPlane.IntersectsBoxLike(Vector3d, Vector3d) |
16 | 100% line / 100% branch | Plane-vs-bounds classification is branch-heavy but fixed-shape and allocation-free. | Additional bound shapes are added and a shared allocation-free helper becomes clearer. |
FixedMathSharp |
FixedBoundFrustum.Contains(FixedBoundArea) |
14 | 100% line / 100% branch | Frustum containment combines plane checks and area corners without allocating an intermediate shape. | Containment semantics change or a shared allocation-free corner helper is introduced. |
FixedMathSharp |
FixedBoundFrustum.Contains(FixedBoundBox) |
14 | 100% line / 100% branch | Frustum containment combines plane checks and box corners without allocating an intermediate shape. | Containment semantics change or a shared allocation-free corner helper is introduced. |
FixedMathSharp |
FixedBoundFrustum.Contains(FixedBoundSphere) |
14 | 100% line / 100% branch | Frustum containment must distinguish disjoint, intersecting, and fully contained sphere cases. | Sphere/frustum containment semantics change or the plane classification helper is redesigned. |
FixedMathSharp |
FixedBoundFrustum.IntersectsFrustum(FixedBoundFrustum) |
14 | 100% line / 100% branch | Separating-axis frustum checks are algorithmically branch-heavy and intentionally avoid allocations. | A robust shared SAT helper can improve clarity without extra allocations or worse benchmarks. |
FixedMathSharp |
FixedBoundBox.ClosestPointOnSurface(Vector3d) |
14 | 100% line / 100% branch | The nearest-face selection is fixed-shape and explicit; helper extraction would not reduce real complexity. | Box surface projection grows beyond nearest-face selection. |
FixedMathSharp |
FixedCurve.Evaluate(Fixed64) |
14 | 100% line / 100% branch | Curve evaluation combines clamping, segment search, and interpolation mode dispatch in one readable flow. | More interpolation modes are added or segment lookup becomes a performance bottleneck. |
FixedMathSharp |
Fixed3x3.TryFormat(...) |
14 | 100% line / 100% branch | Matrix span formatting writes a fixed 3x3 shape without temporary strings. | Formatting shape changes or a shared zero-allocation formatter becomes available. |
FixedMathSharp |
FixedMath.Pow2(Fixed64) |
14 | 100% line / 100% branch | Fixed-point exponent approximation is compact, deterministic, and performance-sensitive. | Approximation strategy changes or benchmark evidence supports decomposition. |
FixedMathSharp |
FixedMath.Tan(Fixed64) |
14 | 100% line / 100% branch | Tangent delegates through fixed trigonometric identities and guarded edge handling. | New domain behavior is added or uncovered lines become reachable with valid input. |
FixedMathSharp |
Vector3d.TryFormat(...) |
14 | 100% line / 100% branch | Vector span formatting writes a fixed component shape without temporary strings. | Formatting shape changes or a shared zero-allocation formatter becomes available. |
FixedMathSharp |
Fixed64.op_Multiply(Fixed64, Fixed64) |
12 | 100% line / 100% branch | Full-width multiply with saturating and round-half-to-even behavior requires explicit guarded paths. | Additional uncovered reachable branches appear, arithmetic semantics change, or benchmarks support a simpler equivalent. |
FixedMathSharp |
Fixed3x3.get_Item(int) |
12 | 100% line / 100% branch | Switch-based fixed matrix indexing is direct and avoids table allocation or reflection. | The matrix layout changes or generated indexer code becomes part of the build. |
FixedMathSharp |
Fixed3x3.set_Item(int, Fixed64) |
12 | 100% line / 100% branch | Switch-based fixed matrix indexing is direct and avoids table allocation or reflection. | The matrix layout changes or generated indexer code becomes part of the build. |
FixedMathSharp |
FixedBoundFrustum.Contains(Vector3d) |
12 | 100% line / 100% branch | Point containment checks all frustum planes directly and avoids temporary arrays. | Plane ordering or containment semantics change. |
FixedMathSharp |
FixedBoundFrustum.Intersects(FixedRay) |
12 | 100% line / 100% branch | Slab-style frustum clipping has unavoidable enter/exit branches and benefits from locality. | More ray/frustum edge cases are discovered or clipping logic is shared elsewhere. |
FixedMathSharp |
FixedMath.FloorLog2(ulong) |
12 | 100% line / 100% branch | Bit-scan fallback is branch-heavy by nature and must remain deterministic across targets. | A target-safe intrinsic or simpler implementation is introduced. |
FixedMathSharp |
FixedQuaternion.FromEulerAngles(Fixed64, Fixed64, Fixed64) |
12 | 100% line / 100% branch | Validates three angles and builds the quaternion in a compact deterministic path. | Angle validation policy changes or Euler conversion variants are added. |
FixedMathSharp |
Fixed4x4.AppendRow(...) |
12 | 100% line / 100% branch | Private span-format helper appends a fixed row shape with delimiter handling and no temporary strings. | Formatting shape changes or a shared zero-allocation formatter becomes available. |
- Methods at 100% line and branch coverage with direct component-wise logic should usually remain explicit unless a zero-overhead generated approach is introduced.
- For fixed-point arithmetic and trigonometric routines, prefer benchmark-backed refactors over structural changes made only to reduce the reported complexity number.
- If a method remains above the complexity threshold and below full branch coverage, prefer adding focused tests for reachable branches before refactoring.
- Re-run coverage and CRAP analysis after any changes that touch the methods listed above, then update this register.