BookStack
PHPSelf-hosted documentation and wiki platform built with Laravel
The new PHP analyzer finds all 340 literal Laravel route registrations in BookStack, 339 of them with an exact controller action, and 695 of the 696 classes it declares sit exactly where Composer's PSR-4 autoloading expects them. Laravel's dynamic APIs leave 45% of the PHP call sites unresolved, and the page says which.
Call resolution (75,448 call sites)
- Resolved in the repository
- 24,193
- To libraries or the standard library
- 13,275
- Ambiguous (several possible targets)
- 51
- Unresolved (could be repo code)
- 37,929
The rate above is resolved ÷ (resolved + ambiguous + unresolved). Calls to libraries and the standard library cannot reach this repository, so they are shown separately and left out of it. Test code is included in these counts.
What the analysis shows
A separate count of literal Route::get|post|put|patch|delete(...) registrations in routes/web.php and routes/api.php finds 340; the analyzer's route inventory has the same number for those files, and 339 of its 340 routes point to an exact controller method.
For 696 classes, interfaces, traits and enums the analyzer declares under the composer.json PSR-4 directories, 695 are in exactly the file PSR-4 prescribes; the exception is a helper class defined inside a test file. Composer itself is never run.
33,107 PHP call sites; 6,055 (18%) resolve to a method or function declared in BookStack, through $this, static calls, typed parameters and typed or promoted properties.
8,953 calls are on chained expressions whose type is unknown without the framework source (query builders, ->first()->...), 1,490 are methods inherited from framework base classes such as Eloquent's Model, and 2,015 are Laravel helper functions (config(), trans(), redirect()). The framework is never installed, so these stay unresolved instead of being guessed.
17 Artisan commands are recorded as entry points. The 325 Blade templates are parsed as PHP files; their directives are template text, not PHP code, so they contribute files but almost no calls.
Largest cycle group
- resources/js/components/index.ts
- resources/js/components/page-comment.ts
- resources/js/components/page-comments.ts
- resources/js/components/pointer.ts
- resources/js/components/toolbox-contents.ts
- resources/js/components/wysiwyg-editor-tinymce.js
- resources/js/components/wysiwyg-input.ts
- resources/js/services/drawio.ts
- resources/js/wysiwyg-tinymce/config.js
- resources/js/wysiwyg-tinymce/plugin-drawio.js
- resources/js/wysiwyg/api/api.ts
- resources/js/wysiwyg/api/content.ts
- resources/js/wysiwyg/api/ui.ts
- resources/js/wysiwyg/index.ts
- resources/js/wysiwyg/lexical/clipboard/clipboard.ts
- resources/js/wysiwyg/lexical/clipboard/index.ts
- resources/js/wysiwyg/lexical/core/LexicalCommands.ts
- resources/js/wysiwyg/lexical/core/LexicalConstants.ts
- resources/js/wysiwyg/lexical/core/LexicalEditor.ts
- resources/js/wysiwyg/lexical/core/LexicalEditorState.ts
- resources/js/wysiwyg/lexical/core/LexicalEvents.ts
- resources/js/wysiwyg/lexical/core/LexicalGC.ts
- resources/js/wysiwyg/lexical/core/LexicalMutations.ts
- resources/js/wysiwyg/lexical/core/LexicalNode.ts
- resources/js/wysiwyg/lexical/core/LexicalNormalization.ts
- resources/js/wysiwyg/lexical/core/LexicalReconciler.ts
- resources/js/wysiwyg/lexical/core/LexicalSelection.ts
- resources/js/wysiwyg/lexical/core/LexicalUpdates.ts
- resources/js/wysiwyg/lexical/core/LexicalUtils.ts
- resources/js/wysiwyg/lexical/core/index.ts
30 of 139 shown
Most widely called symbols (calling files)
- app/App/helpers.php#setting (69)
- app/App/helpers.php#user (60)
- tests/TestCase.php#Tests\TestCase::asAdmin (54)
- tests/TestCase.php#Tests\TestCase::asEditor (49)
- resources/js/wysiwyg/lexical/core/LexicalSelection.ts#$getSelection (37)
- resources/js/wysiwyg/lexical/core/shared/invariant.ts#invariant (34)
Endpoints (first rows of the inventory)
- DELETE /pages/{id} -> app/Entities/Controllers/PageApiController.php#BookStack\Entities\Controllers\PageApiController::delete
- DELETE /roles/{id} -> app/Users/Controllers/RoleApiController.php#BookStack\Users\Controllers\RoleApiController::delete
- DELETE /users/{id} -> app/Users/Controllers/UserApiController.php#BookStack\Users\Controllers\UserApiController::delete
- DELETE /chapters/{id} -> app/Entities/Controllers/ChapterApiController.php#BookStack\Entities\Controllers\ChapterApiController::delete
- DELETE /books/{id} -> app/Entities/Controllers/BookApiController.php#BookStack\Entities\Controllers\BookApiController::delete
- DELETE /shelves/{id} -> app/Entities/Controllers/BookshelfApiController.php#BookStack\Entities\Controllers\BookshelfApiController::delete
- DELETE /attachments/{id} -> app/Uploads/Controllers/AttachmentApiController.php#BookStack\Uploads\Controllers\AttachmentApiController::delete
- DELETE /comments/{id} -> app/Activity/Controllers/CommentApiController.php#BookStack\Activity\Controllers\CommentApiController::delete
8 of 340 shown
Limitations
- Route middleware and names added after the registration call (
->middleware(),->name()) are not recorded; group-level prefixes are. - 50% of call sites stay unresolved: 40% of them are PHP calls on Laravel facades, Eloquent query builders and helper functions, and 60% are calls in the project's front-end JavaScript on values whose type is not known statically.
- Static analysis records relationships visible in the source. It does not see dynamic loading, reflection, or behaviour at runtime; verify important conclusions in the code.
Download the analysis
A full bundle of a large repository exceeds many models' context windows; the focused slices below answer one question each in a fraction of the size.
Focused slices
Every cycle group with its members and size.
scc-summary
The most depended-on and most dependent files, with the reasons they rank high.
hub-summary
Everything that depends on the main hub, two levels deep.
blast-radius
Test-side callers reachable from the most-called symbol (see limitations).
affected-tests
Detected frameworks and how their registrations were resolved.
framework-summary
Routes and handlers, with method, path and target.
framework-inventory
Resolved calls to the most-called symbol, with call sites.
call-diagnostics
Ready to run this on your own codebase?
Hosted analyses use the same analyzer as this demo, within your usage limits.