Repository Analysis

josdejong/mathjs

An extensive math library for JavaScript and Node.js

6.8 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of josdejong/mathjs, a JavaScript project with 15,067 GitHub stars. SynthScan v2.0 examined 163,717 lines of code across 1146 source files, recording 203 pattern matches distributed across 5 syntactic categories. The overall adjusted score of 6.8 places this repository in the Low AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

6.8
Adjusted Score
6.8
Raw Score
100%
Time Factor
2026-07-30
Last Push
15.1K
Stars
JavaScript
Language
163.7K
Lines of Code
1.1K
Files
203
Pattern Hits
2026-08-02
Scan Date
0.13
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

Longitudinal tracking requires multiple scan runs. Once this repository is re-scanned after new commits land, this chart will visualise how the synthetic code signal evolves over time — enabling you to detect whether AI authorship is growing, stabilising, or being actively corrected by human engineers.

No multi-scan history yet — run the scanner again to build trend data.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 3HIGH 151MEDIUM 0LOW 49

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 203 distinct pattern matches across 5 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Cross-Language Confusion (JS/TS)151 hits · 1016 pts
SeverityFileLineSnippetContext
HIGHtypes/index.d.ts3388 print(CODE
HIGHtypes/index.d.ts7086 print(CODE
HIGHexamples/expressions.js22print(evaluate('sqrt(3^2 + 4^2)')) // 5CODE
HIGHexamples/expressions.js23print(evaluate('sqrt(-4)')) // 2iCODE
HIGHexamples/expressions.js24print(evaluate('2 inch to cm')) // 5.08 cmCODE
HIGHexamples/expressions.js25print(evaluate('cos(45 deg)')) // 0.70711CODE
HIGHexamples/expressions.js29print(evaluate([CODE
HIGHexamples/expressions.js43print(evaluate('a * b', scope)) // 12CODE
HIGHexamples/expressions.js46print(evaluate('c = 2.3 + 4.5', scope)) // 6.8CODE
HIGHexamples/expressions.js47print(scope.c) // 6.8CODE
HIGHexamples/expressions.js53print(evaluate('hello("hero")', scope)) // "hello, hero!"CODE
HIGHexamples/expressions.js57print(f(2)) // 8CODE
HIGHexamples/expressions.js58print(scope.f(2)) // 8CODE
HIGHexamples/expressions.js74print(node1.toString()) // "sqrt((3 ^ 2) + (4 ^ 2))"CODE
HIGHexamples/expressions.js78print(node1.evaluate()) // 5CODE
HIGHexamples/expressions.js84print(node2.toString()) // "x ^ a"CODE
HIGHexamples/expressions.js89print(code2.evaluate(scope2)) // 9CODE
HIGHexamples/expressions.js93print(code2.evaluate(scope2)) // 27CODE
HIGHexamples/expressions.js133print(myParser.evaluate('sqrt(3^2 + 4^2)')) // 5CODE
HIGHexamples/expressions.js134print(myParser.evaluate('sqrt(-4)')) // 2iCODE
HIGHexamples/expressions.js135print(myParser.evaluate('2 inch to cm')) // 5.08 cmCODE
HIGHexamples/expressions.js136print(myParser.evaluate('cos(45 deg)')) // 0.70710678118655CODE
HIGHexamples/expressions.js140print(myParser.evaluate('x = 7 / 2')) // 3.5CODE
HIGHexamples/expressions.js141print(myParser.evaluate('x + 3')) // 6.5CODE
HIGHexamples/expressions.js142print(myParser.evaluate('f2(x, y) = x^y')) // f2(x, y)CODE
HIGHexamples/expressions.js143print(myParser.evaluate('f2(2, 3)')) // 8CODE
HIGHexamples/expressions.js150print(myParser.evaluate('k = [1, 2; 3, 4]')) // [[1, 2], [3, 4]]CODE
HIGHexamples/expressions.js151print(myParser.evaluate('l = zeros(2, 2)')) // [[0, 0], [0, 0]]CODE
HIGHexamples/expressions.js152print(myParser.evaluate('l[1, 1:2] = [5, 6]')) // [5, 6]CODE
HIGHexamples/expressions.js153print(myParser.evaluate('l')) // [[5, 6], [0, 0]]CODE
HIGHexamples/expressions.js154print(myParser.evaluate('l[2, :] = [7, 8]')) // [7, 8]CODE
HIGHexamples/expressions.js155print(myParser.evaluate('l')) // [[5, 6], [7, 8]]CODE
HIGHexamples/expressions.js156print(myParser.evaluate('m = k * l')) // [[19, 22], [43, 50]]CODE
HIGHexamples/expressions.js157print(myParser.evaluate('n = m[2, 1]')) // 43CODE
HIGHexamples/expressions.js158print(myParser.evaluate('n = m[:, 1]')) // [[19], [43]]CODE
HIGHexamples/expressions.js111print(code3.evaluate()) // 5CODE
HIGHexamples/expressions.js120print(scope3.a) // 10CODE
HIGHexamples/expressions.js170print(myParser.evaluate('i / 2')) // 250CODE
HIGHexamples/expressions.js174print(myParser.evaluate('hello("hero")')) // "hello, hero!"CODE
HIGHexamples/basic_usage.js23print(round(e, 3)) // 2.718CODE
HIGHexamples/basic_usage.js24print(atan2(3, -3) / pi) // 0.75CODE
HIGHexamples/basic_usage.js25print(log(10000, 10)) // 4CODE
HIGHexamples/basic_usage.js26print(sqrt(-4)) // 2iCODE
HIGHexamples/basic_usage.js27print(pow([[-1, 2], [3, 1]], 2)) // [[7, 0], [0, 7]]CODE
HIGHexamples/basic_usage.js28print(derivative('x^2 + x', 'x')) // 2 * x + 1CODE
HIGHexamples/basic_usage.js33print(evaluate('1.2 * (2 + 4.5)')) // 7.8CODE
HIGHexamples/basic_usage.js34print(evaluate('12.7 cm to inch')) // 5 inchCODE
HIGHexamples/basic_usage.js35print(evaluate('sin(45 deg) ^ 2')) // 0.5CODE
HIGHexamples/basic_usage.js36print(evaluate('9 / 3 + 2i')) // 3 + 2iCODE
HIGHexamples/basic_usage.js37print(evaluate('det([-1, 2; 3, 1])')) // -7CODE
HIGHexamples/basic_usage.js46print(a) // 14CODE
HIGHexamples/basic_usage.js51print(add(4, [5, 6])) // number + Array, [9, 10]CODE
HIGHexamples/basic_usage.js52print(multiply(unit('5 mm'), 3)) // Unit * number, 15 mmCODE
HIGHexamples/basic_usage.js53print(subtract([2, 3, 4], 5)) // Array - number, [-3, -2, -1]CODE
HIGHexamples/basic_usage.js54print(add(matrix([2, 3]), [4, 5])) // Matrix + Array, [6, 8]CODE
HIGHexamples/import.js20print(math.myConstant * 2) // 84CODE
HIGHexamples/import.js21print(math.hello('user')) // 'hello, user!'CODE
HIGHexamples/import.js23print(math.evaluate('myConstant + 10')) // 52CODE
HIGHexamples/import.js24print(math.evaluate('hello("user")')) // 'hello, user!'CODE
HIGHexamples/import.js40 print(math.fibonacci(7)) // 13CODE
91 more matches not shown…
Hallucination Indicators3 hits · 45 pts
SeverityFileLineSnippetContext
CRITICALtest/unit-tests/expression/security.test.js235 math.evaluate('cos.syntax="global.eval";s=unit("5 cm");s.units=[]._data;s.value=cos;s._compile=s.toString;expressiCODE
CRITICALtest/unit-tests/expression/security.test.js241 math.evaluate('expression.node.ConstantNode.prototype.clone.call({"value":"evaluate"}).evaluate()("console.log(\'hCODE
CRITICALtest/unit-tests/expression/security.test.js247 math.evaluate('c(x,y)="console.log(\'hacked...\')";expression.node.Node.prototype.compile.apply({_compile:c}).evalCODE
Hyper-Verbose Identifiers21 hits · 22 pts
SeverityFileLineSnippetContext
LOWgulpfile.js219function generateEntryFilesCallback (done) {CODE
LOWtools/entryGenerator.js192function generateDependenciesFiles ({ suffix, factories, entryFolder }) {CODE
LOWtest/unit-tests/function/probability/random.test.js135function assertUniformDistribution (values, min, max) {CODE
LOWtest/unit-tests/function/algebra/derivative.test.js11 function derivativeWithoutSimplify (expr, value) {CODE
LOW…t/unit-tests/function/algebra/decomposition/qr.test.js59function assertValidQRDecomposition (A, Q, R) {CODE
LOWtest/unit-tests/expression/parse.test.js30function parseAndStringifyWithParens (expr) {CODE
LOWsrc/factoriesNumber.js340function createNumberOptionalSecondArgFactory (name, fn) {CODE
LOWsrc/core/function/import.js370 function hasTypedFunctionSignature (fn) {CODE
LOWsrc/core/function/import.js378 function factoryAllowedInExpressions (factory) {CODE
LOWsrc/core/function/import.js384 function isTransformFunctionFactory (factory) {CODE
LOWsrc/utils/array.js928 function recursiveForEachWithIndex (value, depth) {CODE
LOWsrc/utils/snapshot.js97export function createSnapshotFromFactories (factories) {CODE
LOWsrc/utils/bignumber/bitwise.js215function decCoefficientToBinaryString (x) {CODE
LOWsrc/function/matrix/matrixFromColumns.js69 function checkVectorTypeAndReturnLength (vec) {CODE
LOWsrc/function/matrix/matrixFromRows.js58 function checkVectorTypeAndReturnLength (vec) {CODE
LOWsrc/type/number.js29function makeNumberFromNonDecimalParts (parts) {CODE
LOWsrc/expression/parse.js1065 function parseMultiplyDivideModulus (state) {CODE
LOWsrc/expression/parse.js1101 function parseImplicitMultiplication (state) {CODE
LOWsrc/expression/node/FunctionAssignmentNode.js107 return function evalFunctionAssignmentNode (scope, args, context) {CODE
LOWsrc/expression/node/OperatorNode.js48 function calculateNecessaryParentheses (root, parenthesis, implicit, args, latex) {CODE
LOWsrc/expression/node/RangeNode.js19 function calculateNecessaryParentheses (node, parenthesis, implicit) {CODE
TODO Padding15 hits · 22 pts
SeverityFileLineSnippetContext
LOW…t/unit-tests/function/algebra/simplifyConstant.test.js64 // TODO: implement support for simplification of constant sub-expressions for inverses ofCOMMENT
LOWtest/generated-code-tests/entry/mainNumber.test.js140 // TODO: implement support for subset in number implementationCOMMENT
LOWbin/cli.js413 // TODO: implement configuration via command line argumentsCOMMENT
LOWsrc/utils/bignumber/formatter.js158 // TODO: implement support for upper and lower to be BigNumbers themselvesCOMMENT
LOWsrc/function/statistics/prod.js41 // TODO: implement prod(A, dim)COMMENT
LOWsrc/function/statistics/median.js96 // TODO: implement median(A, dim)COMMENT
LOWsrc/function/probability/permutations.js69 // TODO: implement support for collection in permutationsCOMMENT
LOWsrc/function/probability/combinations.js61 // TODO: implement support for collection in combinationsCOMMENT
LOWsrc/function/complex/arg.js48 // TODO: implement BigNumber support for function argCOMMENT
LOWsrc/function/arithmetic/divide.js55 // TODO: implement matrix right division using pseudo inverseCOMMENT
LOWsrc/function/arithmetic/xgcd.js40 // TODO: implement support for FractionCOMMENT
LOWsrc/function/bitwise/rightLogShift.js61 // 'BigNumber, BigNumber': ..., // TODO: implement BigNumber support for rightLogShiftCOMMENT
LOWsrc/type/matrix/Range.js267 // TODO: implement a caching mechanism for range.valueOf()COMMENT
LOWsrc/type/matrix/MatrixIndex.js75 // TODO: implement support for wildcard '*'COMMENT
LOWsrc/expression/node/IndexNode.js62 // TODO: implement support for bignumber (currently bignumbers are silentlyCOMMENT
Over-Commented Block13 hits · 12 pts
SeverityFileLineSnippetContext
LOWtools/whitelistgenerator.js101 // 'cbrt': true,COMMENT
LOW…t/unit-tests/function/algebra/simplifyConstant.test.js61 // collapsing of constants with a 'falsy' value (e.g. '0')COMMENT
LOWexamples/expressions.js61//COMMENT
LOWexamples/advanced/function_transform.js41// result: 6COMMENT
LOWexamples/advanced/custom_loading.js21// Use the created functionsCOMMENT
LOWexamples/advanced/convert_fraction_to_bignumber.js1// Convert from Fraction to BigNumberCOMMENT
LOWexamples/advanced/more_secure_eval.js1// Expression parser securityCOMMENT
LOWsrc/utils/is.js1// type checks for all known typesCOMMENT
LOWsrc/function/matrix/eigs/complexEigs.js21 // R is the row transformation matrixCOMMENT
LOWsrc/function/algebra/simplify.js201 phi: true,COMMENT
LOWsrc/function/algebra/rationalize.js401 }COMMENT
LOWsrc/function/algebra/sparse/csAmd.js81 // select node of minimum approximate degree. amd() is now ready to start eliminating the graph. It firstCOMMENT
LOWsrc/expression/operators.js1// list of identifiers of nodes in order of their precedenceCOMMENT