Most popular Mocking framework for unit tests written in Java
This report summarizes scanner evidence for mockito/mockito, a Java project with 15,452 GitHub stars. SynthScan examined 109,300 lines of code across 1058 source files, recording 18 pattern matches distributed across 5 syntactic categories. The legacy adjusted pattern signal is 0.4 (Low pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Payload schema: 1.0.0 · Engine: 2.0.0 · Scoring: heuristic-density-v1 · Scan date: 2026-10-31.
Can maintainers explain intent, assumptions, and trade-offs? 14 finding(s).
Are imports declared and package/API names verified? 4 finding(s).
Are wrappers, guards, and repeated structures necessary? 0 finding(s).
Which changes need focused human review? 18 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 18 distinct pattern matches across 5 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. 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 configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| CRITICAL | …o/errorprone/bugpatterns/MockitoInternalUsageTest.java | 44 | " org.mockito.internal.configuration.GlobalConfiguration.validate();", | CODE |
| CRITICAL | …ava/org/mockitousage/annotation/SpyAnnotationTest.java | 220 | // org.mockito.internal.creation.instance.ConstructorInstantiator.withParams() | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | …to/internal/framework/DefaultMockitoFrameworkTest.java | 162 | + "When you add a listener, don't forget to remove the listener afterwards:\n" | CODE |
| LOW | …o-core/src/main/java/org/mockito/MockitoFramework.java | 59 | * When you add listener using {@link #addListener(MockitoListener)} make sure to remove it. | COMMENT |
| MEDIUM | mockito-core/src/main/java/org/mockito/Mockito.java | 1009 | * <li>@{@link Spy} - you can use it instead {@link Mockito#spy(Object)}. | COMMENT |
| MEDIUM | mockito-core/src/main/java/org/mockito/Mockito.java | 1020 | * Just like for @{@link Mock} annotation you can use the built-in runner: {@link MockitoJUnitRunner} or rule: | COMMENT |
| LOW | …ain/java/org/mockito/internal/exceptions/Reporter.java | 1191 | "When you add a listener, don't forget to remove the listener afterwards:", | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | …/test/java/org/mockito/internal/util/PlatformTest.java | 61 | null, | COMMENT |
| LOW | …/test/java/org/mockito/internal/util/PlatformTest.java | 81 | // java.vm.specification.version 1.9 9 | COMMENT |
| LOW | …ore/src/test/java/org/mockitousage/PlaygroundTest.java | 41 | // mock = mock(Foo.class, withSettings() | COMMENT |
| LOW | …ore/src/test/java/org/mockitousage/PlaygroundTest.java | 61 | // | COMMENT |
| LOW | …ore/src/test/java/org/mockitousage/PlaygroundTest.java | 81 | // | COMMENT |
| LOW | …ckitousage/misuse/DescriptiveMessagesOnMisuseTest.java | 41 | // doReturn("bar"); | COMMENT |
| LOW | …ousage/matchers/MatchersMixedWithRawArgumentsTest.java | 21 | // description of an idea: | COMMENT |
| LOW | …l/creation/bytebuddy/access/MockMethodInterceptor.java | 61 | public Object doIntercept( | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | …/org/mockitousage/stubbing/SmartNullsStubbingTest.java | 142 | "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the ind | CODE |
| LOW | …/org/mockitousage/stubbing/SmartNullsStubbingTest.java | 149 | assertThat(e).hasMessageContaining("Lorem Ipsum"); | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | …java/org/mockito/internal/handler/MockHandlerImpl.java | 82 | // We need to check if verification was started on the correct mock | COMMENT |