Repository navigation
Releases: tamada/pelicode
Releases · tamada/pelicode
Release list
Release v0.1.0
The first release of pelicode, a research prototype that tells you where your code may have come from.
pelicode keeps a database of the functions of published open-source packages, and checks a project, or only what a change touches, against it. It reports similar code candidates to review, each with the package, version, file, lines and license it was found in. It does not decide whether code was copied: similar code is no proof of copying, and copying is not always a problem.
The database holds hashes, locations and licenses, never source code.
What it can do
- Languages: Go, Java, Kotlin, Python, Ruby and Rust, function by function (Tree-sitter), normalized at four levels: layout, identifiers and literals, types, structure.
- Repositories: PyPI, Maven Central, the Go module proxy, RubyGems and crates.io.
- Downloads are verified against the digests the repositories publish, licenses are identified, and requests are paced.
crawl --top Nfetches the best-known packages of each.crawl --updatesfetches the new versions of the packages in a database.
- Matching: exact matches after normalization, and similar matches through winnowing fingerprints, MinHash and LSH. Code common to many packages is left out, and so are the dependencies of the checked project, read from its lock files.
- Checking: directories, a git range (
--git main...HEAD), or what is staged (--staged, for pre-commit hooks). The results come as text, JSON, CSV, or SARIF for GitHub code scanning. - Settings file:
.pelicode.yamlor.pelicode.json5in the repository. - Sharing databases:
pelicode snapshotwrites a copy for checking only.- Snapshots of the best-known 500 packages of each ecosystem are published monthly in quay.io (
quay.io/tama5/pelicode-db). scan --db oci://quay.io/tama5/pelicode-db:pypi-latestfetches, verifies and caches one; several can be checked at once.
- Maintenance:
pelicode statsrefreshes the counts of common hashes incrementally, andpelicode cleanremoves data no version refers to any more.
Install
brew install tamada/tap/pelicode
cargo install pelicode-cli
docker run --rm -v "$PWD":/workdir quay.io/tama5/pelicode --helpArchives for Linux, macOS and Windows (x64 and arm64) are attached to this release. See the installation guide and Getting Started.
pelicode scan ./src --db oci://quay.io/tama5/pelicode-db:pypi-latestKnown limitations
- Defaults: the default parameters (k, thresholds, the stop threshold) rest on preliminary observations; the evaluation planned in §11 of the specification has not been done yet.
- git:
--gitand--stagedneed thegitcommand (#6). - Rankings: the best-known packages of Maven Central and Go are ranked by the number of repositories that depend on them, since those repositories publish no download counts.
- Scale: measured up to 1.3 million functions per database (§11.3 of the specification); larger databases are untried.
- GitHub Action: the action for pull requests lives in tamada/pelicode-action, with releases of its own.