Codeception / Codeception/c3

Minor improvements to pass psecio-parse's scan

オープン
#58 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
PHP
スター
73
フォーク
46
PR マージ指標
30日以内にマージされた PR はありません

説明

### To run report:
```
composer global require psecio/parse
~/.composer/vendor/bin/psecio-parse scan c3.php
```

### And its results:

1) /var/www/html/tests/c3.php on line 45
'header()' calls should not use concatenation directly
```
header('X-Codeception-CodeCoverage-Error: ' . str_replace("\n", ' ', $message), true, 500);
```
For more information execute 'psecio-parse rules SetHeaderWithInput'

2) /var/www/html/tests/c3.php on line 69
Avoid using AND, OR and XOR (in favor of || and &&) as they may cause subtle precedence bugs
```
if (!class_exists('PHP_CodeCoverage') and class_exists('SebastianBergmann\CodeCoverage\CodeCoverage')) {
```
For more information execute 'psecio-parse rules LogicalOperators'

3) /var/www/html/tests/c3.php on line 137
The third parameter should be set (and be true) on in_array to avoid type switching issues
```
if (in_array('GZ', Phar::getSupportedCompression())) {
```
For more information execute 'psecio-parse rules TypeSafeInArray'

4) /var/www/html/tests/c3.php on line 184
The third parameter should be set (and be true) on in_array to avoid type switching issues
```
if (in_array('GZ', Phar::getSupportedCompression())) {
```
For more information execute 'psecio-parse rules TypeSafeInArray'

5) /var/www/html/tests/c3.php on line 204
The readfile/readlink/readgzfile functions output content directly (possible injection)
```
readfile($filename);
```
For more information execute 'psecio-parse rules Readfile'

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

c3.php に対して psecio-parse scan を実行し、tests/c3.php で報告された行を確認します。header の連結、論理演算子、in_array の型チェック、readfile に関する5件の指摘を修正し、その後 scan を再実行して、これらの指摘がなくなったことを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
php
領域
testing
issue の種類
リファクタリング
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。