Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@md-code/entities-uniqueness

Latest version: v0.3.2

Overview

Last scanned
29 Nov 2026
Published
29 Nov 2026
npm package Publisher: mikita_du
0 Stars
0 Forks
1 Versions
227 Downloads
TypeScript Repo language

Scan summary

@md-code/entities-uniqueness was last scanned on 29 Nov 2026 at version 0.3.2. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: First and only release on 29 Nov 2026.
  • Findings: No rules fired in version 0.3.2.
  • Downloads: 227 downloads.

Versions

1 version published
Versions and the rules that fired in each
VersionPublishedStatus
0.3.2 LATEST 29 Nov 2026 No rules fired

No rules fired in 0.3.2

Findings

Findings for v0.3.2. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.3.2; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

@md-code/entities-uniqueness

ESLint rule and CLI that find semantically close entities — classes, interfaces, type aliases, object literals, factory functions, and framework shapes (zod schemas, mobx stores, redux/zustand state, class-validator models) — across a set of files.

Unlike a "duplicate a canonical component" tool, this analyzes the whole included set against itself: every entity is compared with every other, so you surface near-duplicates and extraction opportunities wherever they live.

flowchart LR
    A["Included files<br/>classes · interfaces · types · zod · stores"] --> N["Normalize<br/>canonical types + framework shapes"]
    N --> M["Match<br/>properties · methods · signature · name · inheritance"]
    M --> D["Decide<br/>weighted confidence + tier"]
    D --> F["Filter<br/>usages · inheritance · framework residual"]
    F --> C["Cluster + Suggest<br/>shared base / shared type / subset"]
    C --> R["Report + Catalog"]

Install

pnpm add -D @md-code/entities-uniqueness
Package Where it comes from Why
@md-code/utils dependencies the shared file index and the repo-root helpers (installed for you)
typescript dependencies, ^5.5.0 every entity is parsed with the TypeScript compiler API
eslint >=8.40.0 peerDependencies the rule is an ESLint rule; bring your own ESLint
@md-code/sections optional peer ^0.3.0 only the --overview page / overviewPath needs it (see below)

Installed for you as well (dependencies): @reduxjs/toolkit (redux state shapes), minimatch (the globs) and ts-morph (the TypeScript AST).

Node >=18. The prebuilt overview bundle ships inside dist/, so a published install needs no bundler, React or UI kit at all.

Minimal configuration — ESLint flat config plus one rule:

// eslint.config.js
const plugin = require("@md-code/entities-uniqueness");

module.exports = [
    {
        files: ["src/**/*.{ts,tsx}"],
        plugins: { "md-code": plugin },
        rules: {
            // error tier → severity 2 (red).
            "md-code/entities-uniqueness": ["error", { roots: ["src"] }],
            // warn tier → severity 1 (yellow). ESLint fixes severity per RULE, so the
            // warn tier is a second rule; enable it to see the yellow findings.
            "md-code/entities-uniqueness-warn": ["warn", { roots: ["src"] }],
        },
    },
];

Quick start

# 1. build the catalog and see what it finds (writes reports/entities-catalog.json).
#    Optional: with `cache: true` the rule refreshes this catalog itself on lint.
npx md-code-entities-uniqueness --roots src

# 2. lint — the rule reads that catalog and reports duplicates in the buffer
npx eslint src

Generate the catalog again whenever the scanned sources change; it is a build artifact and should be gitignored. A plain npx md-code-entities-uniqueness with no flags uses the rule options found in eslint.config.js (see Configuration discovery).

From this repository, build the package once and drive the CLI on its dist/ output:

pnpm build
node dist/main.js --roots packages/cli/src --report reports/entities-similarity.md
node dist/main.js --roots packages/cli/src --overview reports/entities-overview.html

node dist/main.js --help prints the authoritative flag list; the table below is that list with the parser's types and defaults (plus --overview, which the parser accepts and the usage line forgets).

How confidence is scored

Each pair of entities is scored on five signals, each in 0..1:

Signal Weight What it measures
properties 0.25 Jaccard + overlap of property names, blended with type agreement
methods 0.30 Jaccard + overlap of method names
signature 0.20 Of shared methods, how many agree on canonical params + return type
name 0.15 Levenshtein + token overlap of the entity names
inheritance 0.10 Jaccard of extends/implements heritage

Two-pool model. A signal that carries no information for a pair (e.g. two entities with no methods) is not a neutral 1.0 — it reports hasEvidence: false and scores 0. The name signal is always on (names always exist); the other four participate only when they have evidence. The identity budget (the error threshold, 0.85 by default) is re-normalized over the evidencing signals only, so a pair with no methods is judged on properties + name alone instead of getting a free 0.30 from an empty methods set.

Properties signal details. The raw name overlap (0.6·jaccard + 0.4·overlap) is blended with type agreement on the shared names: when shared keys disagree on canonical type (Record<K, string> vs Record<K, number>), at most half of the name-overlap score is kept. A small-shape discount then pulls scores just under 1.00 when the union of property names is tiny — two unrelated {id, name} seed records sharing two generic fields is not a 1.00 match. The evidence object exposes jaccard, overlap, typeAgreement, aCount, bCount, union.

Shape extraction. The normalizer surfaces the real shape of an entity:

  • constructor parameter properties (constructor(readonly from: string)) are promoted to properties;
  • numeric ({1: ...}) and computed keys are not semantic properties and are skipped;
  • an object whose members are factory functions (queryOptions: () => ({...})) is scored on the returned object's members, not on a single queryOptions property — otherwise any two such objects would match at 1.00 on that one shared name.

Severity tiers:

Tier Range Severity Meaning
error ≥ 0.85 error (2, red) Near-duplicate — strong candidate to delete/merge
extract 0.50 – 0.85 error (2, red) Strong extraction candidate
warn 0.35 – 0.50 warn (1, yellow) Weak similarity, informational

Thresholds and weights are both configurable (see Rule options). Threshold keys are error, extract and warn; an unknown/old key is a hard error listing the accepted keys and what each means.

What it reports

The ESLint rule fires on each entity that participates in a matched pair:

messageId Fires when Severity
duplicateEntity The entity is a near-duplicate (tier error) error (2)
nearDuplicateEntity The entity is an extraction candidate (tier extract) or weak similarity (tier warn) extract → error (2); warn → warn (1)
indexNotBuilt The shared index is cold (see Shared file index) warn (1)

The rule does not report a pair twice: an entity that matches several others is reported once per matched partner, and the report and catalog carry the full picture — every pair with all five signal scores, the clusters, and refactor suggestions.

Rule options

The rule option object is validated against the schema in index.ts (additionalProperties: false). Every key below is accepted; unknown keys are a configuration error.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @md-code/entities-uniqueness

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (3)
Research

Ruby2Shell: Ruby Memory Corruption Flaws Expose Applications to Remote Code Execution, But is it an Actual Risk?

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Vulnerability Insights

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?

Vulnerability Insights

OpenSSH Password Authentication Bypass on Alpine Linux (*sshole) – CVE-2026-123158

Frame 2085668439 (1)
Group 1261154229