Skip to content

[Bug]: PHP short-open-tag parser exceeds complexity threshold #1647

Description

@ben-ranford

Summary

parseShortOpenTagSetting has a baseline complexity finding in internal/lang/php/composer_ingestion.go. Its conservative scope handling must survive simplification.

Reproduction steps

Run main-branch Sonar analysis and inspect parseShortOpenTagSetting and its existing configuration-ingestion tests.

Expected behavior

Maintain final-assignment rules and incomplete results for unresolved scoped settings while meeting the configured complexity threshold.

Actual behavior

Sonar reports cognitive complexity31 for the parser.

Logs and output

Sonar issue keys: AaBSdlYJZAs_M-b0Um1H.

Version / commit

ff07368 (main baseline).

Environment

SonarQube Cloud project ben-ranford_lopper; baseline analysis 5a0cdcfb-5c8c-4dae-a90d-d0de97975465, inspected 2026-09-15.

Scope and acceptance criteria

Separate line classification, section-depth updates and directive parsing. Preserve .htaccess sections, INI/php_value/php_flag forms, quoted comments, interpolation, unrelated sections, oversized inputs and file-wide uncertainty. Add behavior-lock tests before refactoring; run the PHP adapter suite and Sonar.

Release assignment

This needs a coordinated behavior-preserving refactor and is assigned to v1.9.0. It is outside the acceptance criteria of the current v1.8.8 PRs.

Live Sonar findings

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtarget-series:1.9.xRelease series targeting label

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions