不要コード一斉摘発!自動でいらないコードを見つけるアレコレ

 不要コード一斉摘発!自動でいらないコードを見つけるアレコレ

PHPカンファレンス福岡2018のLT発表資料です。
以下の資料の改訂版となります。
https://speakerdeck.com/nazonohito51/regasipurodakutodeiranaikodowozi-dong-dejian-tuketakatuta?slide=1

B989cc865d53d8e26fdadac99727113c?s=128

Satoshi Kawashima

June 16, 2018
Tweet

Transcript

  1. ࣗಈͰ͍Βͳ͍ίʔυΛݟ͚ͭΔΞϨίϨ ઒ౡܛ(.01FQBCP *OD 1)1ΧϯϑΝϨϯε෱Ԭ ෆཁίʔυҰ੪ఠൃʂ վ గ ൛

  2. IUUQOB[POPIJUPKVHFNKQ ΞϓϦέʔγϣϯΤϯδχΞ ઒ౡܛ!OB[POPIJUP 4)ࣄۀ෦+6(&.νʔϜ

  3. TDIPP͞ΜͰ-BSBWFMͷतۀΛ࡞Γ·ͨ͠

  4. ͍Βͳ͍ίʔυ࢒ͬͯ·ͤΜʁ

  5. ΊͬͪΌ͋Δ

  6. w ೥΋ͷαʔϏε w ίϐϖจԽͰඞཁແ͍ͷʹ͍࣋ͬͯͨίʔυͱ͔ͨ͘͞Μ ͋Δ w ͻͲ͍΋ͷ͸ϦϙδτϦ͝ͱίϐʔ͍ͯͨ͠ ͏ͪͷ৔߹

  7. w ௐࠪίετ͕͔͔Δ w HSFQ͢Δͱ༨ܭͳ΋ͷ͕ͻ͔͔ͬΔ w ಡΉίʔυ͕ଟ͘ͳΔ w मਖ਼ίετ͕͔͔Δ w ඞཁͳίʔυ͕ͲΕ͔෼͔Βͳ͍͔Β݁ہશ෦௚͢

    w σϓϩΠίετ͕͔͔Δ ͍Βͳ͍ίʔυ͕࢒͍ͬͯΔͱ
  8. ૟আͷ࢓ํΛ͝঺հ͠·͢

  9. wຊ൪؀ڥͰ࣮ߦ͞Εͨͷ͸ཁΔίʔυ wຊ൪؀ڥͰ࣮ߦ͞Εͳ͍ͷ͸ཁΒͳ͍ίʔυ ͍Βͳ͍ίʔυͷݟ͚ͭํ ຊ൪؀ڥͰಈతղੳ͢Δ

  10. wϑΝΠϧϨϕϧͰղੳ wϑΝϯΫγϣϯϨϕϧͰղੳ wεςʔτϝϯτϨϕϧͰղੳ ࢥ͍͍ͭͨํ๏

  11. ϑΝΠϧϨϕϧͰղੳ

  12. w HFU@JODMVEFE@pMFT ͰSFRVJSF͞ΕͨQIQϑΝΠϧ͕BSSBZ ͰऔΕΔ w SFHJTUFS@TIVUEPXO@GVODUJPO Ͱऴྃ࣌ʹˢΛอଘ ϑΝΠϧϨϕϧͰղੳ [ array

    (size=221) 0 => string '/home/vagrant/code/public/index.php' (length=44) 1 => string '/home/vagrant/code/prof_test/web.php' (length=45) 2 => string '/home/vagrant/code/bootstrap/autoload.php' (length=50) 3 => string '/home/vagrant/code/vendor/autoload.php' (length=47) 4 => string '/home/vagrant/code/vendor/composer/autoload_real.php' (length=61) 5 => string '/home/vagrant/code/vendor/composer/ClassLoader.php' (length=59) 6 => string '/home/vagrant/code/vendor/composer/autoload_static.php' (length=63) 7 => string '/home/vagrant/code/vendor/myclabs/deep-copy/src/DeepCopy/ deep_copy.php' (length=79)
  13. ϑΝϯΫγϣϯϨϕϧͰղੳ

  14. w 1)1ίʔυ͔ΒϑΝϯΫγϣϯݺͼग़͠ΛϑοΫ͢Δ͜ͱ ͸ʢجຊతʹʣͰ͖ͳ͍ w $ݴޠϨϕϧͷ֦ுʢ&YUFOTJPOʣͳΒՄೳ ϑΝϯΫγϣϯϨϕϧͰղੳ ϓϩϑΝΠϥΛ࢖༻͢Δ

  15. [ array (size=1784) 'Illuminate\Support\Collection::__construct==>Illuminate\Support \Collection::getArrayableItems' => array (size=2) 'ct' =>

    int 31 'wt' => int 37 'Illuminate\Routing\Router::addWhereClausesToRoute==>Illuminate\Routing \Route::getAction' => array (size=2) 'ct' => int 44 'wt' => int 129 'Barryvdh\LaravelIdeHelper \IdeHelperServiceProvider::createLocalViewFactory==>Illuminate\View \Factory::addExtension' => array (size=2) 'ct' => int 1 'wt' => int 16 UJEFXBZT@YIQSPGͷղੳ݁Ռ ˡݺͼग़͠ݩݺͼग़͠ઌ ˡݺͼग़͠ճ਺ ˡॲཧ࣌ؒ
  16. w 9IQSPG1)1 w UJEFXBZT@YIQSPG1)1 w UJEFXBZT༗ྉ4BB4ʢIUUQTUJEFXBZTDPNʣ w CBDLpSF༗ྉ4BB4ʢIUUQTCMBDLpSFJPʣ w 9EFCVHϓϩϑΝΠϥҎ֎ʹ΋৭ʑ͍ͭͯ͘Δͷ͕ෆ҆

    ϓϩϑΝΠϥͷछྨ
  17. ύϑΥʔϚϯε΁ͷӨڹ UJEFXBZT@YIQSPGͷ༗ແʹΑΔॲཧ࣌ؒ ॲཧ࣌ؒʢTFDʣ       

    ϑΝϯΫγϣϯݺͼग़͠ճ਺ʢճʣ        ϓϩϑΝΠϥ͋Γ ϓϩϑΝΠϥແ͠ -BSBWFMͷ ϗʔϜը໘දࣔ   
  18. εςʔτϝϯτϨϕϧͰͷղੳ

  19. w ຊ൪؀ڥͰίʔυΧόϨοδΛऔΔ w QIQECH͸8&#αʔόͱซ༻Ͱ͖ͳ͍ʢʹ9EFCVHҰ୒ʣ w ˞ຊ൪؀ڥʹ9EFCVHΛೖΕͯ͠·͏ϦεΫ͸ࠓճ৮Ε· ͤΜ εςʔτϝϯτϨϕϧͰղੳ

  20. [ array ( '/home/vagrant/code/vendor/guzzlehttp/promises/src/functions.php' => array ( 21 => 1,

    42 => 1, 66 => 1, 92 => 1, 108 => 1, 122 => 1, 147 => 1, 174 => 1, ), '/home/vagrant/code/pwa_test/vendor/laravel/framework/src/Illuminate/Routing/Route.php' => array ( 20 => 1, 22 => 1, 132 => 1, 133 => 1, 134 => 1, 9EFCVHͷίʔυΧόϨοδ݁Ռ ˢղੳର৅ͷϑΝΠϧ ˡ࣮ߦ͞Εͨߦ൪߸
  21. w -BSBWFMͷϗʔϜը໘Ͱܭଌ w TFDTFD   w ຊ౰ʹඞཁͳίʔυ͚ͩΛૂ͍ܸͪͰղੳ͢Δ ύϑΥʔϚϯε΁ͷӨڹ [

    xdebug_set_filter( XDEBUG_FILTER_CODE_COVERAGE, XDEBUG_PATH_WHITELIST, [__DIR__ . “/src/”] ); ˡղੳର৅ΛϗϫΠτϦετͰ੍ݶ
  22. ࡟আͨ݁͠Ռ

  23. ϑΝΠϧϨϕϧͰ࡟আͨ݁͠Ռ         ϑΝΠϧ਺ɿˠݸ

    ߦ਺ɿˠߦʢ࡟আʣ ϑΝΠϧ਺ɿˠݸ ߦ਺ɿˠߦʢ࡟আʣ ϑΝΠϧ਺ɿˠݸ ߦ਺ɿˠߦʢ࡟আʣ ϑΝΠϧ਺ɿˠݸ ߦ਺ɿˠߦʢ࡟আʣ
  24. օ͞Μ΋࡟আͯ͠Έͯ͸ʁ

  25. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠