Skip to content
CAI
Software that uses CAICheck a score

tid-kijyun/Kanna

58.1

Adequate · 1 October 2026

1.5k

lines of production code

Swift

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Kanna is a Swift library for parsing and manipulating HTML and XML documents, leveraging libxml2 for core functionality. It provides capabilities for CSS selector-to-XPath conversion, node modification, and namespace handling across Apple platforms and Linux. The system supports modern Swift versions and includes thread-safe parsing, with distribution managed via Swift Package Manager, CocoaPods, and Carthage.

Features

Automated release script for Kanna

A new shell script (script/release.sh) has been added to automate the release process for the Kanna library. This tool handles version validation, updates the CocoaPods spec and iOS Info.plist files, creates and pushes Git tags, and publishes the package to CocoaPods, streamlining the workflow for maintainers.

script · high confidence

Initial project structure and build configuration for Kanna

This change introduces the foundational Xcode project structure for the Kanna library, including the main project file, workspace configuration, and build schemes. It establishes the build targets for the Kanna framework and its associated test suite, defining the source files (such as Kanna.swift, CSS.swift, and various libxml wrappers) and test resources. This configuration enables developers to build, test, and archive the library using Xcode.

Kanna.xcodeproj · high confidence

Behavioural changes

Configured libxml2 module map for Swift Package Manager compatibility

The project now includes a module map and umbrella header for libxml2, allowing Swift Package Manager to consume the library directly on macOS (Xcode 11.4+) without requiring manual installation via Homebrew. This change shifts the library linkage configuration from the project level to the module map, resolving build errors and simplifying the setup process for macOS users.

Modules · high confidence

Initial project scaffolding and legacy code removal

This change establishes the repository's foundational structure by adding essential configuration and documentation files, including a .gitignore for Xcode and Swift Package Manager artifacts, a SwiftLint configuration, an MIT LICENSE, and a comprehensive README.md detailing installation via CocoaPods, Carthage, and Swift Package Manager. Concurrently, it removes obsolete legacy source files (HTMLNode.swift, HTMLParser.swift, main.swift, and the bridging header) that are no longer part of the current codebase, effectively cleaning up the project history to reflect the modern library structure.

(repo-wide) · high confidence

Kanna 6.0.1: Swift 6 support and thread-safe CSS parsing

This release updates the library to support Swift 6 and introduces thread safety for the CSS selector-to-XPath conversion. The \regexDict\ cache in \CSS.swift\ is now protected by an \NSLock\ to prevent crashes when accessed from multiple threads, and the dictionary is marked \nonisolated(unsafe)\ for Swift 5.9+ compatibility. Additionally, the \ParseOption\ enums and \Libxml2HTMLParserOptions\/\Libxml2XMLParserOptions\ structs now conform to \Sendable\ for Swift 5.5+, and the \Info.plist\ version is bumped to 6.0.1.

Sources · high confidence

Updated build configurations to support visionOS and modern deployment targets

The project's Xcode configuration files have been updated to enable cross-platform support, specifically adding visionOS (XROS) as a supported platform with a deployment target of 1.0. Minimum deployment targets have been raised to macOS 10.15, iOS 13.0, tvOS 13.0, and watchOS 4.0. The build settings now include visionOS in the supported platforms and runtime search paths, ensuring the library can be built and linked for Apple Vision devices alongside existing Apple platforms.

Configurations · high confidence

Test coverage

Initial test suite and test data for Kanna

Added the \KannaTests\ test bundle, including \LinuxMain.swift\ for Linux execution, a \Bundle+\ helper for locating resources, and several test classes (\KannaHTMLTests\, \KannaXMLTests\, \KannaCSSTests\, \KannaHTMLModifyingTests\, \KannaXMLModifyingTests\, \KannaTutorialsTests\). These tests cover HTML and XML parsing, CSS-to-XPath conversion, node modification, and namespace handling, supported by new test data files such as \test\_HTML4.html\, \test\_XML\_ExcelWorkbook.xml\, \pptx-presentation.xml\, and \libraries.xml\.

Tests · high confidence

Dependencies

Kanna 6.0.1: New platform support and privacy manifest

The Kanna XML/HTML parser library has been updated to version 6.0.1, introducing support for visionOS (deployment target 1.0) and adding a PrivacyInfo.xcprivacy resource bundle to comply with modern privacy requirements. The package now targets Swift 5.0 and 6.0, with minimum deployment targets set to iOS 13.0, macOS 10.15, tvOS 13.0, and watchOS 10.0. The Swift Package Manager configuration has been refined to conditionally depend on the system libxml2 library only when necessary (excluding Linux and Swift 5.3+ on non-Linux platforms), ensuring smoother builds across different environments.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 59 → 58 (-0.8)
  • Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 100 → 94 (-5.8)
  • Architecture 100 → 100 (+0.0)
  • Maturity 37 → 37 (+0.0)
  • Readiness 55 → 58 (+3.3)
  • Security 97 → 97 (+0.0)

Resolved (2)

  • Documentation: no usage examples (README.md)
  • Repeated repair: Sources/Kanna/libxmlHTMLDocument.swift (Sources/Kanna/libxmlHTMLDocument.swift)

New (9)

  • CSS.swift.getAttribute (cognitive 52) (Sources/Kanna/CSS.swift)
  • CSS.swift.getAttribute (cyclomatic 35) (Sources/Kanna/CSS.swift)
  • Coverage not measured — Swift suite
  • Dependency hygiene PARTLY measured — SwiftPM pinning read, dependency currency NOT established
  • Duplicate parsing functions with inconsistent return types and parameter types. The 'Kanna.swift' module provides non-optional returns and uses a typed 'Encoding' enum, while 'Deprecated.swift' provides optional returns and uses raw 'UInt' for encoding. This creates confusion about which entry point to use and why the return types differ.
  • Duplicate parsing functions with inconsistent return types. 'Kanna.swift.HTML' returns 'HTMLDocument', while 'Deprecated.swift.HTML' returns 'XMLDocument?'. This is a semantic inconsistency where the same operation (parsing HTML) yields different types depending on which module is used.
  • Duplicated block (12 lines × 2) (Sources/Kanna/CSS.swift)
  • Duplicated block (12 lines × 2) (Sources/Kanna/libxmlHTMLDocument.swift)
  • MethodTooLong: Encoding.IANACharSetName (Sources/Kanna/libxmlHTMLDocument.swift)

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

tid-kijyun/Kanna 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 1 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 3c73af6d3859d9240db60aef233941a715387744 — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.