A pure PHP library for reading and writing word processing documents
This report summarizes scanner evidence for PHPOffice/PHPWord, a PHP project with 7,590 GitHub stars. SynthScan examined 94,449 lines of code across 679 source files, recording 341 pattern matches distributed across 4 syntactic categories. The legacy adjusted pattern signal is 3.5 (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-11-11.
Can maintainers explain intent, assumptions, and trade-offs? 331 finding(s).
Are imports declared and package/API names verified? 10 finding(s).
Are wrappers, guards, and repeated structures necessary? 285 finding(s).
Which changes need focused human review? 341 finding(s).
Run additional scans to build a history of the legacy pattern signal. Score changes are not a measure of AI adoption or code quality.
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 341 distinct pattern matches across 4 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 |
|---|---|---|---|---|
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 90 | public function xtestTemplateCanBeSavedInTemporaryLocation(string $templateFqfn, TemplateProcessor $templateProcesso | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 137 | public function testXslStyleSheetCanBeApplied(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 173 | public function testXslStyleSheetCanNotBeAppliedOnFailureOfSettingParameterValue(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 201 | public function testXslStyleSheetCanNotBeAppliedOnFailureOfLoadingXmlFromTemplate(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 272 | public function testCloneRowWithCustomMacro(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 354 | public function testCloneNotExistingRowShouldThrowException(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 368 | public function testCloneRowAndSetValuesWithCustomMacro(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 429 | public function testMacrosCanBeReplacedInHeaderAndFooter(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 450 | public function testCustomMacrosCanBeReplacedInHeaderAndFooter(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 487 | public function testSetValueWithCustomMacro(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 553 | public function testSetComplexValueWithCustomMacro(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 687 | public function testSetValuesWithCustomMacro(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 782 | public function testSetCheckboxWithCustomMacro(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 937 | public function testSetImageValueMetafile(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 985 | public function testSetImageValueInvalidImage(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 997 | public function testSetImageValueUnsupportedImage(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 1009 | private function getImageTemplateProcessor(): TemplateProcessor | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 1048 | public function testGetVariableCountCountsHowManyTimesEachPlaceholderIsPresent(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 1085 | public function testGetVariableCountCountsHowManyTimesEachPlaceholderIsPresentWithCustomMacro(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 1123 | public function testCloneBlockCanCloneABlockTwice(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 1176 | public function testCloneBlockCanCloneABlockTwiceWithCustomMacro(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 1260 | public function testCloneBlockWithCustomMacro(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 1290 | public function testCloneBlockWithVariables(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 1321 | public function testCloneBlockWithVariablesAndCustomMacro(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 1350 | public function testCloneBlockWithVariableReplacements(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 1383 | public function testCloneBlockWithVariableReplacementsAndCustomMacro(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 1453 | public function testFixBrokenMacrosWithCustomMacro(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 1483 | public function testMainPartNameDetection(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 1495 | public function testMainPartNameDetectionWithCustomMacro(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 1525 | public function testGetVariablesWithCustomMacro(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 1559 | public function testTextNeedsSplittingWithCustomMacro(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 1589 | public function testSplitTextIntoTextsWithCustomMacro(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 1644 | public function testFindXmlBlockStartWithCustomMacro(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 1688 | public function testShouldReturnFalseIfXmlBlockNotFound(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 1715 | public function testShouldReturnFalseIfXmlBlockNotFoundWithCustomMacro(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 1743 | public function testShouldMakeFieldsUpdateOnOpen(): void | CODE |
| LOW | tests/PhpWordTests/TemplateProcessorTest.php | 1757 | public function testShouldMakeFieldsUpdateOnOpenWithCustomMacro(): void | CODE |
| LOW | tests/PhpWordTests/SettingsTest.php | 110 | public function testSetGetOutputEscapingEnabled(): void | CODE |
| LOW | tests/PhpWordTests/SettingsTest.php | 177 | public function testSetGetMeasurementUnit(): void | CODE |
| LOW | tests/PhpWordTests/SettingsTest.php | 191 | public function testPhpTempDirIsUsedByDefault(): void | CODE |
| LOW | tests/PhpWordTests/SettingsTest.php | 214 | public function testSetGetDefaultFontName(): void | CODE |
| LOW | tests/PhpWordTests/SettingsTest.php | 228 | public function testSetGetDefaultAsianFontName(): void | CODE |
| LOW | tests/PhpWordTests/SettingsTest.php | 242 | public function testSetGetDefaultFontSize(): void | CODE |
| LOW | tests/PhpWordTests/SettingsTest.php | 262 | public function testSetGetDefaultFontColor(): void | CODE |
| LOW | tests/PhpWordTests/AbstractWebServerEmbedded.php | 57 | protected static function getRemoteImageUrlWithoutExtension(): string | CODE |
| LOW | tests/PhpWordTests/PhpWordTest.php | 65 | public function testSetGetDefaultFontName(): void | CODE |
| LOW | tests/PhpWordTests/PhpWordTest.php | 77 | public function testSetGetDefaultFontSize(): void | CODE |
| LOW | tests/PhpWordTests/PhpWordTest.php | 89 | public function testSetGetDefaultAsianFontName(): void | CODE |
| LOW | tests/PhpWordTests/PhpWordTest.php | 101 | public function testSetGetDefaultFontColor(): void | CODE |
| LOW | tests/PhpWordTests/PhpWordTest.php | 113 | public function testSetDefaultParagraphStyle(): void | CODE |
| LOW | tests/PhpWordTests/PhpWordTest.php | 181 | public function testGetNotExistingSection(): void | CODE |
| LOW | tests/PhpWordTests/IOFactoryTest.php | 72 | public function testExistingWriterCanBeCreated(): void | CODE |
| LOW | tests/PhpWordTests/IOFactoryTest.php | 83 | public function testNonexistentWriterCanNotBeCreated(): void | CODE |
| LOW | tests/PhpWordTests/IOFactoryTest.php | 92 | public function testExistingReaderCanBeCreated(): void | CODE |
| LOW | tests/PhpWordTests/IOFactoryTest.php | 103 | public function testNonexistentReaderCanNotBeCreated(): void | CODE |
| LOW⚡ | tests/PhpWordTests/MediaTest.php | 35 | public function testGetSectionMediaElementsWithNull(): void | CODE |
| LOW⚡ | tests/PhpWordTests/MediaTest.php | 43 | public function testGetHeaderMediaElementsWithNull(): void | CODE |
| LOW⚡ | tests/PhpWordTests/MediaTest.php | 51 | public function testGetFooterMediaElementsWithNull(): void | CODE |
| LOW⚡ | tests/PhpWordTests/MediaTest.php | 59 | public function testCountSectionMediaElementsWithNull(): void | CODE |
| LOW⚡ | tests/PhpWordTests/MediaTest.php | 67 | public function testAddSectionMediaElement(): void | CODE |
| 225 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/PhpWordTests/Shared/ZipArchiveTest.php | 41 | // { | COMMENT |
| LOW | samples/Sample_07_TemplateCloneRow.php | 61 | $templateProcessor->cloneRowAndSetValues('userId', $values); | COMMENT |
| LOW | src/PhpWord/Reader/MsDoc.php | 201 | COMMENT | |
| LOW | src/PhpWord/Reader/MsDoc.php | 221 | // envr | COMMENT |
| LOW | src/PhpWord/Reader/MsDoc.php | 2121 | } else { | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 1 | <?php | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 21 | // this software the author can not be responsible. | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 41 | //define( 'PCLZIP_SEPARATOR', ' ' ); | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 61 | // - MUST be a valid, already created directory | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 81 | // -------------------------------------------------------------------------------- | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 181 | // Attributes : | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 201 | COMMENT | |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 221 | } | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 241 | // are added in the archive. See the parameters description for the | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 261 | // PCLZIP_OPT_REMOVE_ALL_PATH : | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 401 | if ($v_result != 1) { | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 421 | // $p_filelist : An array containing file or directory names, or | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 581 | // ----- Return | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 601 | // folder : true | false | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 641 | if (($v_result = $this->privList($p_list)) != 1) { | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 661 | // you can indicate this in the optional $p_remove_path parameter. | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 801 | COMMENT | |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 821 | // Options : | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 961 | // ----- Call the extracting fct | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 1061 | // Function : properties() | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 1181 | return $v_result; | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 1321 | // -------------------------------------------------------------------------------- | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 1361 | } | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 1381 | // $p_size) and generate an array with the options and values ($v_result_list). | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 1941 | COMMENT | |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 2261 | $this->privSwapBackMagicQuotes(); | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 2321 | $this->zip_fd = 0; | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 2381 | if (($v_result = $this->privWriteCentralHeader($v_count, $v_size, $v_offset, $v_comment)) != 1) { | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 2701 | // ----- Update the informations | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 2961 | // -------------------------------------------------------------------------------- | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 3101 | // -------------------------------------------------------------------------------- | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 3141 | // -------------------------------------------------------------------------------- | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 3441 | $this->privSwapBackMagicQuotes(); | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 4261 | } | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 4441 | $p_central_dir['disk_start'] = $v_data['disk_start']; | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 4721 | return $v_result; | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 4941 | COMMENT | |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 5101 | } | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 5181 | // $p_dir. | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 5301 | } | COMMENT |
| LOW | src/PhpWord/Shared/PCLZip/pclzip.lib.php | 5361 | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | tests/PhpWordTests/Writer/Word2007/Element/TOCTest.php | 67 | $staticHtml = '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. | CODE |
| LOW⚡ | tests/PhpWordTests/Writer/Word2007/Element/TOCTest.php | 67 | $staticHtml = '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. | CODE |
| LOW | docs/usage/template.md | 121 | $templateProcessor->setValue('Name', 'John Doe'); | CODE |
| LOW | samples/Sample_05_Multicolumn.php | 8 | $filler = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. ' | CODE |
| LOW | samples/Sample_05_Multicolumn.php | 8 | $filler = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. ' | CODE |
| LOW | samples/Sample_26_Html.php | 23 | $html .= '<p style="text-align: justify; text-indent: 70.9pt; line-height: 150%;">Lorem ipsum dolor sit amet, <strong>co | CODE |
| LOW | samples/Sample_26_Html.php | 23 | $html .= '<p style="text-align: justify; text-indent: 70.9pt; line-height: 150%;">Lorem ipsum dolor sit amet, <strong>co | CODE |
| LOW | samples/Sample_13_Images.php | 37 | $text = str_repeat('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore | CODE |
| LOW | samples/Sample_13_Images.php | 37 | $text = str_repeat('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| CRITICAL | samples/bootstrap/js/jquery.min.js | 5 | }({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e. | CODE |