Minor improvements to pass psecio-parse's scan

オープン
#58 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

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

調査の方向性

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

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

説明

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'

  1. /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'

  1. /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'

  1. /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'

  1. /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'

主要言語
PHP
スター
73
フォーク
46
PR マージ指標
30日以内にマージされた PR はありません

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

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

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Codeception/c3 のほかの issue

Codeception/c3 の issue をすべて見る

似ている issue

PHP の issue をもっと見る

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

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