guoyingtao/Mantis
55.4
Adequate · 15 November 2026
13.7k
lines of production code
Swift
primary language
5
measurements over time
What this system is
Features
New SwiftUI example app for Mantis
The repository now includes a complete SwiftUI example project (MantisSwiftUIExample) that demonstrates how to integrate the Mantis image-cropping library in SwiftUI applications. The demo showcases both the modern declarative API (using ImageCropper and CropSession for state-driven cropping with custom toolbars) and the legacy binding-based API (ImageCropperView) for migration reference. It features a comprehensive feature list allowing users to test various cropping options such as different crop shapes (rect, circle, heart, arbitrary paths), aspect ratios, perspective correction, and rotation controls. The app also includes helper views for selecting images from the photo library or camera, and adapts its layout for different screen sizes and orientations.
SwiftUIExample · high confidence
Behavioural changes
1 commit (0 fixes) modifying .swiftpm
A change to existing behaviour in .swiftpm — 1 commit, 1 file: “feat!: add MantisCore, a UIKit-free crop engine that also runs on macOS (\#559)” (refs \#559). Also in this area: Added Swift Package Manager workspace configuration.
.swiftpm · medium confidence · unverified
35 commits (3 fixes) modifying Example/Base.lproj
A change to existing behaviour in Example/Base.lproj — 35 commits (3 fixs), 2 files: “Improved rotation”; “feat: Add crop shape list to the Example project”; “\#29 How can I change Grid overlay programmatically?”; and 32 more (refs \#29, \#463, \#111, \#169, \#220, …).
Example/Base.lproj · medium confidence · unverified
5 commits (1 fix) modifying Example/MantisExample.xcodeproj/xcshareddata
A change to existing behaviour in Example/MantisExample.xcodeproj/xcshareddata — 5 commits (1 fix), 1 file: “Remove warnings (\#183)”; “fix: use createBackupCGContext in cgImageWithFixedOrientation (\#414)”; “chore: update project settings”; and 2 more (refs \#183, \#414, \#379).
Example/MantisExample.xcodeproj/xcshareddata · medium confidence · unverified
8 commits (3 fixes) modifying Example/zh-Hans.lproj
A change to existing behaviour in Example/zh-Hans.lproj — 8 commits (3 fixs), 2 files: “feat: add more custom crop shapes (\#111)”; “Add CropAuxiliaryIndicatorConfig to allow custom CropAuxiliaryIndicator colors (\#403)”; “fix: solve pan gesture conflict (\#220)”; and 5 more (refs \#111, \#403, \#220, \#404, \#379, …).
Example/zh-Hans.lproj · medium confidence · unverified
CropView refactored into focused extensions with added accessibility and skew support
The CropView implementation has been reorganized into modular Swift extensions (Crop, Flip, Layout, Rotation, Skew) to improve maintainability. This change introduces VoiceOver and Switch Control support for the crop overlay handles via dedicated accessibility helper views, and adds perspective skew correction capabilities that allow users to adjust horizontal and vertical skew angles directly from the rotation control. Also in this area: 3 commits (1 fix) modifying Sources; Improved crop view layout and accessibility on foldable devices; Mantis crop library restructured with new configuration and appearance system; Crop toolbar and view controller refactored into modular extensions with undo/redo support; New declarative SwiftUI image cropper with session-based control; and 5 more.
Sources · medium confidence · unverified
Example project restructured with new demo architecture and custom UI components
The Example project has been completely reorganized to demonstrate the library's capabilities. A new \DemoViewController\ serves as the main entry point, featuring a menu for various cropping modes (Normal, Embedded, Transformation, Headless, etc.) and a switch to toggle between standard and large test images. The previous \ViewController\ and \Main.storyboard\ have been replaced. New files demonstrate advanced features: \CustomViewController\ shows how to subclass \CropViewController\ for custom navigation items; \CustomizedCropToolbar\ and \CustomizedCropToolbarWithoutList\ provide examples of implementing \CropToolbarProtocol\ for fully custom toolbars; \CustomWaitingIndicator\ shows how to implement \ActivityIndicatorProtocol\; and \EmbeddedCropViewController\ demonstrates embedded cropping with Undo/Redo support and resolution display. The \AppDelegate\ has also been updated to include a custom menu bar with Undo/Redo/Revert commands for macOS Catalyst support. Also in this area: 1 commit (0 fixes) modifying Example, Mantis.xcodeproj, SwiftUIExample.
Example, Example/MantisExample.xcodeproj · medium confidence
Test coverage
Comprehensive unit test coverage for Mantis core geometry and UI components
Added a new suite of unit tests in the Tests directory to verify the correctness of the library's core mathematical helpers and UI components. These tests cover angle conversions and arithmetic, CoreGraphics vector operations (including NaN/infinity detection), CGAffineTransform composition for crop transforms, and the specific resize logic for both free and locked-aspect crop boxes. Additionally, tests validate the new CIImage-based large-image crop pipeline against the legacy implementation, ensure CropInfo round-trips correctly via Codable for persistence, and verify the behavior of the declarative ImageCropper modifiers and CropSession state management.
Tests · high confidence
Dependencies
Add CocoaPods and Swift Package Manager support for Mantis 3.1.0
The Mantis library is now distributable via CocoaPods and Swift Package Manager (SPM). A new Mantis.podspec defines version 3.1.0 with a minimum iOS deployment target of 15.0, while Package.swift configures the SPM package for iOS and Mac Catalyst 15.0, including a privacy manifest (PrivacyInfo.xcprivacy) and localization resources. Example projects (MantisExample and MantisSwiftUIExample) have been updated with Podfiles to consume the local library, enabling users to integrate Mantis into their projects using standard dependency managers. Also in this area: 2 commits updating dependencies (5 manifests).
(dependencies) · medium confidence · unverified
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 56 → 55 (-0.3)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.
Lenses
- Code Health 96 → 95 (-0.3)
- Architecture 92 → 91 (-1.2)
- Maturity 59 → 59 (+0.0)
- Readiness 43 → 43 (-0.5)
- Security 56 → 56 (+0.0)
- Performance 100 → 100 (+0.0)
Resolved (19)
- Assertions commented out: testExample (Example/MantisTests/MantisTests.swift)
- CGImage.transformedImage (cognitive 17) (Sources/Mantis/Extensions/CGImageExtensions.swift)
- CGImage.transformedImage (cyclomatic 18) (Sources/Mantis/Extensions/CGImageExtensions.swift)
- Duplicated block (11 lines × 2) (Sources/Mantis/CropData.swift)
- Duplicated block (16–17 lines × 2) (Sources/Mantis/Extensions/UIImageExtensions.swift)
- Duplicated block (28–35 lines × 2) (Sources/Mantis/Extensions/UIImageExtensions.swift)
- Duplicated block (5 lines × 2) (Sources/Mantis/CropViewController/ToolBarButtonImageBuilder+DrawImage.swift)
- Duplicated block (6 lines × 2) (Sources/Mantis/CropView/CropBoxFreeAspectFrameUpdater.swift)
- Duplicated block (7 lines × 2) (Sources/Mantis/Extensions/UIImageExtensions.swift)
- Duplicated block (8 lines × 2) (Sources/Mantis/RotationDial/SlideDial/SlideDialTypeButton.swift)
- Duplicated block (9–16 lines × 2) (Sources/Mantis/Extensions/UIImageExtensions.swift)
- High: security finding (details withheld)
- Near-duplicate member pair (60 shared lines) (Sources/Mantis/Extensions/UIImageExtensions.swift)
- No assertions: testPerformanceExample (Example/MantisTests/MantisTests.swift)
- Skipped test: testObservationTrackingFiresOniOS17 (Tests/MantisTests/CropSessionTests.swift)
- UIImage.cropWithCIImage (cognitive 25) (Sources/Mantis/Extensions/UIImageExtensions.swift)
- UIImage.cropWithCIImage (cyclomatic 26) (Sources/Mantis/Extensions/UIImageExtensions.swift)
- UIImage.cropWithPerspective (cognitive 24) (Sources/Mantis/Extensions/UIImageExtensions.swift)
- UIImage.cropWithPerspective (cyclomatic 25) (Sources/Mantis/Extensions/UIImageExtensions.swift)
New (31)
- CGImage.cropWithPerspective (cognitive 18) (Sources/MantisCore/CGImage+Crop.swift)
- CGImage.cropWithPerspective (cyclomatic 19) (Sources/MantisCore/CGImage+Crop.swift)
- CGImage.transformedImage (cognitive 17) (Sources/MantisCore/CGImageExtensions.swift)
- CGImage.transformedImage (cyclomatic 18) (Sources/MantisCore/CGImageExtensions.swift)
- Duplicated block (6 lines × 2) (Sources/Mantis/CropView/CropBoxFreeAspectFrameUpdater.swift)
- Duplicated block (6 lines × 2) (Sources/Mantis/CropViewController/CropToolbar.swift)
- Edited copies of one member (3 members, 12+ corresponding lines) (Sources/Mantis/AppearanceColorPreset.swift)
- Edited copy of a member (12 corresponding lines) (Sources/Mantis/CropViewController/ToolBarButtonImageBuilder+DrawImage.swift)
- Edited copy of a member (14 corresponding lines) (Sources/Mantis/Mantis.swift)
- Edited copy of a member (16 corresponding lines) (Sources/Mantis/Helpers/PerspectiveTransformHelper.swift)
- Edited copy of a member (17 corresponding lines) (Sources/Mantis/CropView/CropView+Touches.swift)
- Edited copy of a member (21 corresponding lines) (Sources/Mantis/RotationDial/SlideDial/SlideRuler.swift)
- Edited copy of a member (5 corresponding lines) (Sources/Mantis/Helpers/SkewPositioning.swift)
- Edited copy of a member (6 corresponding lines) (Sources/Mantis/Config.swift)
- Edited copy of a member (64 corresponding lines) (Sources/Mantis/RotationDial/SlideDial/SlideDialIconDrawer.swift)
- Edited copy of a member (9 corresponding lines) (Sources/Mantis/CropView/CropView+Layout.swift)
- High interface indirection
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- …and 11 more
Changes since last survey
- 4 commits — 3 feature/other, 1 fixes
By area
- Sources/Mantis — 2 commits
- Tests/MantisTests — 2 commits
Notable commits
- fix: fix: keep ellipse(maskOnly:) crops rectangular and add core unit tests (#557)
- change: feat!: Mantis 4.0 — SwiftPM only, iOS 17, Xcode 16 (#556)
- change: feat!: add MantisCore, a UIKit-free crop engine that also runs on macOS (#559)
- change: test: allow one pixel of slack in SlideDial ruler-ratio checks (#561)
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
guoyingtao/Mantis was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 15 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 95798473fd257a7c25ac9d06ffa8c7f3660f179c — the exact code this score is about.
- Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-3c33c1882dc1.