mirror of
https://github.com/Heretek-AI/heretek-control-core.git
synced 2026-10-12 02:03:55 +00:00
Addresses the first SonarCloud analysis on PR #1 (128 new-code findings). Genuine issues are fixed in code; convention/style rules (camelCase naming php:S100/S101/S116, too-many-returns php:S1142) and the standalone test harnesses are handled via the SonarCloud profile + sonar-project.properties because snake_case + WP_Error guards are the WordPress conventions here. Security: - connector: transfer ids are now whitelisted ([A-Za-z0-9_-]{8,64}) and rejected before any path use; the residual S2083 path-build findings (the resume-keyed store must use the id) carry NOSONAR + rationale after the HMAC gate + strict validation. Complexity (php:S3776) - extracted helpers so no function sits far over the raised threshold: - connector: search_replace -> data_tables/text_columns/rewrite_rows; restore_archive -> restore_db; import -> run_dump_statement. - migrate-abilities: execute_migrate -> push_archive_packets/packet_error/ push_finalize/poll_job. - db-importer: run_statement helper (per-statement execution shared with the trailing no-';' fragment). - restore-engine: restore() -> restore_database(); append_log() dropped its unused $filename parameter. - char-state-machine extractors (extract_statement x2) carry NOSONAR + rationale. Other: - packager: .emcp extension -> const EXT; add_files split into file_iterator/ dir_is_skipped/zip_relative_name. - db-exporter: removed unused $col_ph. - migrate module: single-arg nonces (WP default _wpnonce, matching the view), page-URL helper, dropped unused $back params. - page-migrate view: single-arg wp_nonce_field(). - restore-engine + serialized-search-replace: tabs -> spaces. - sonar-project.properties: exclude tests/** + vendor/** (test harnesses mirror WP core function names by design). Tests: tests/test-migrate-packager.php 8 suites still green; php -l clean. Co-Authored-By: Claude <[email protected]>
17 lines
891 B
Properties
17 lines
891 B
Properties
# SonarCloud analysis scope for Heretek-AI_elementor-mcp.
|
|
#
|
|
# The PHP quality profile deactivates the camelCase naming rules (php:S100 /
|
|
# php:S101 / php:S116) and "too many returns" (php:S1142) because this is a
|
|
# WordPress plugin: snake_case function/class names and WP_Error-guard early
|
|
# returns are the platform convention. php:S3776 (cognitive complexity) runs
|
|
# with a raised threshold so only genuinely huge functions flag.
|
|
#
|
|
# The standalone test harnesses under tests/ deliberately mirror WordPress core
|
|
# function names (wp_normalize_path, esc_url, get_results, ...) so they can run
|
|
# without a database; analysing them as app code produces only noise, so they
|
|
# are excluded here. vendor/ holds committed Composer runtime deps.
|
|
sonar.projectKey=Heretek-AI_elementor-mcp
|
|
sonar.projectName=Heretek-AI elementor-mcp
|
|
sonar.sourceEncoding=UTF-8
|
|
sonar.exclusions=tests/**,**/vendor/**
|