Skip to content

Enabled psalm for php#193

Draft
Br3nda wants to merge 16 commits into
mainfrom
Br3nda-patch-1
Draft

Enabled psalm for php#193
Br3nda wants to merge 16 commits into
mainfrom
Br3nda-patch-1

Conversation

@Br3nda

@Br3nda Br3nda commented May 31, 2026

Copy link
Copy Markdown
Contributor

Relevant issue(s)

openaustralia/openaustralia#858

Enables psalm, which is specifically for php

What does this do?

Psalm is a free & open-source static analysis tool that helps you identify problems in your code

@Br3nda Br3nda requested a review from a team as a code owner May 31, 2026 21:10
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Br3nda added 8 commits June 1, 2026 09:20
Error: scripts/mprss.php:27:1: UnusedVariable: $starttime is never referenced or the value is not used (see https://psalm.dev/077)
Error: scripts/mprss.php:50:39: UnusedVariable: $n is never referenced or the value is not used (see https://psalm.dev/077)
// However, no point checking, if the user can't add terms.
if ($THEUSER->is_able_to('addterm')) {

$args['count'] = $GLOSSARY->hansard_count($args);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i went through git history and this function has never existed. There was a member variable with this name at time of CVS import in 2004, but no method.

Br3nda added 3 commits June 1, 2026 09:38
 Error: scripts/alertgonemps.php:66:13: UnusedVariable: $user_id is never referenced or the value is not used (see https://psalm.dev/077)
Error: scripts/alertgonemps.php:69:13: UnusedVariable: $user_id is never referenced or the value is not used (see https://psalm.dev/077)
Comment thread www/docs/alert/index.php
function check_input($details) {

global $ALERT, $this_page;
global $ALERT;
*/
public function content_start() {
global $DATA, $this_page;
global $DATA;
*/
public function stripe_end($contents = [], $extra = '') {
global $DATA, $this_page;
global $DATA;
*/
public function include_sidebar_template($sidebarname) {
global $this_page, $DATA;
global $DATA;
*/
public function page_footer($extra = null) {
global $DATA, $this_page;
global $DATA;
@@ -1,5 +1,5 @@
<?php
global $PAGE, $DATA, $this_page;
global $PAGE, $DATA;
@@ -1,5 +1,5 @@
<?php
global $PAGE, $DATA, $this_page;
global $PAGE, $DATA;
*/

global $PAGE, $this_page, $GLOSSARY;
global $PAGE, $GLOSSARY;
);
*/
global $PAGE, $this_page, $DATA;
global $PAGE, $DATA;
);
*/
global $PAGE, $this_page, $DATA;
global $PAGE, $DATA;
@github-actions

Copy link
Copy Markdown

Code Coverage

Code Coverage Report:
  2026-05-31 21:58:10

 Summary:
  Classes:  0.00% (0/35)
  Methods:  7.69% (27/351)
  Lines:    2.98% (279/9363)

ALERT
  Methods:   7.14% ( 1/14)   Lines:   0.70% (  1/143)
GLOSSARY
  Methods:  22.22% ( 2/ 9)   Lines:   1.72% (  2/116)
MEMBER
  Methods:   0.00% ( 0/32)   Lines:   4.16% ( 16/385)
MySQL
  Methods:  50.00% ( 3/ 6)   Lines:  53.85% ( 21/ 39)
MySQLQuery
  Methods:  81.82% ( 9/11)   Lines:  86.67% ( 65/ 75)
SEARCHLOG
  Methods:  42.86% ( 3/ 7)   Lines:  62.00% ( 31/ 50)
THEUSER
  Methods:   8.33% ( 1/12)   Lines:  17.48% ( 25/143)
USER
  Methods:  28.57% ( 8/28)   Lines:  14.96% ( 41/274)

@Br3nda Br3nda marked this pull request as draft June 1, 2026 01:25
@sonarqubecloud

sonarqubecloud Bot commented Jun 1, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1.6% Coverage on New Code (required ≥ 80%)
30.1% Duplication on New Code (required ≤ 3%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants