Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
PhpStormで重複コードを一瞬で見つける
Search
Yuichi Sugiyama
PRO
November 27, 2019
Technology
940
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
PhpStormで重複コードを一瞬で見つける
第144回PHP勉強会の発表内容です
Yuichi Sugiyama
PRO
November 27, 2019
More Decks by Yuichi Sugiyama
See All by Yuichi Sugiyama
20年以上続く PHP 大規模プロダクトを Kubernetes へ ── クラウド基盤刷新プロジェクトの4年間
oogfranz
PRO
0
570
サイボウズ と Garoon と The PHP Foundation と 私 / Cybozu and Garoon and The PHP Foundation and me
oogfranz
PRO
1
650
可能な限り確実にmkdirを成功させるには / Make mkdir
oogfranz
PRO
0
780
サイボウズ #Garoon 開発チームの 「 完成度低いの歓迎LT大会 」 PHPerKaigi出張版 / Low quality LT in PHPerKaigi 2023
oogfranz
PRO
0
800
20年ものの巨大プロダクトをKubernetesに移行している話 後日談/Garoon on Kubernetes after talk
oogfranz
PRO
0
670
20年ものの巨大プロダクトをKubernetesに移行している話/Garoon on Kubernetes
oogfranz
PRO
0
590
PHPアプリケーションだってモニタリングしたい / Monitoring PHP application
oogfranz
PRO
1
700
効果的な静的解析の CI導入パターンを求めて / Great static analysis with CI
oogfranz
PRO
3
4.1k
Dev-meets-Ops
oogfranz
PRO
1
1.1k
Other Decks in Technology
See All in Technology
Content Mapper APIの応用例~CSS Modules、言語ファイル~
uhyo
2
360
AI駆動開発におけるハーネスエンジニアリングの勘所
tsukuboshi
1
890
AIがGISを代替する日:〜すべてをAIが創る時代に、私たちがFOSS4Gに関わる意味〜
lehupa
0
130
Technical Project Manager の役割とやりがい、少しだけ AI
yoshiiryo1
0
390
E2Eってつらくないですか?E2Eの管理コストを下げる手段とその実践
akaboshinit
6
2.8k
推論基盤と Scale-Up Interconnect の現状と制約から俯瞰する技術動向
markunet
2
670
クラウドエージェントの先駆け Devin。今も最先端を走る、他との違い
kinopeee
1
520
ビジネス部門からPOを迎えての半年間の進歩と課題
zozotech
PRO
0
170
自律的なチームを作るためにTechPMがやらないこと
ny7760
0
270
200人の配信コメント、 全部Jevが仕分けます 〜 マサカリガードを作ってみた 〜
katayamatg
1
460
Microsoft のサポート ライフサイクルを理解する
murachiakira
PRO
0
240
契約で守るコンパウンドプロダクトのデザインシステム
yug1224
1
1.6k
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Become a Pro
speakerdeck
PRO
31
6.3k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3.1k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
360
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Mobile First: as difficult as doing things right
swwweet
225
10k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
960
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.8k
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.2k
Transcript
PhpStormͰ ॏෳίʔυΛ ҰॠͰݟ͚ͭΔ Cybozu ਿࢁ༞Ұ @oogFranz
Who am I • ਿࢁ ༞Ұ @oogFranz • αΠϘζ5ΤϯδχΞ •
େاۀ͚άϧʔϓΣΞGaroon࡞ͬͯΔʢPHP 7) • ෳۀδϟζϛϡʔδγϟϯ@MASHݭָஂ
PHP ConferenceͰ·͢ʂ
ॏෳίʔυ͋Γ·ͤΜ͔ʁ • ಈ͘ίʔυ͕ίϐϖ͞Ε͍ͯΔ • ෆ۩߹͕͋ͬͨΒॏෳίʔυશͯमਖ਼͕ඞཁ • ػೳՃ͕͋ͬͨΒॏෳίʔυશͯରԠ͕ඞཁ • ίϐϖίʔυΛݟ͚ͭͯॏෳΛऔΓআ͖͍ͨ
ॏෳίʔυ͋Γ·ͤΜ͔ʁ • ಈ͘ίʔυ͕ίϐϖ͞Ε͍ͯΔ • ෆ۩߹͕͋ͬͨΒॏෳίʔυશͯमਖ਼͕ඞཁ • ػೳՃ͕͋ͬͨΒॏෳίʔυશͯରԠ͕ඞཁ • ίϐϖίʔυΛݟ͚ͭͯॏෳΛऔΓআ͖͍ͨ PhpStormͰ؆୯ʹݟ͚ͭΑ͏ʂ
Γ͔ͨ 1. ·ͣPhpStorm 2019.2ΛΠϯετʔϧ͠·͢
Γ͔ͨ 1. ·ͣPhpStorm 2019.2ΛΠϯετʔϧ͠·͢ Ҏ্Ͱ͢
DEMO https://github.com/oogFranz/duplicate-code-test
ॏෳ͕Weak WarningͰ
Diff viewerͰॏෳ۩߹Λ֬ೝ
ม໊ͷҧ͍ݕग़
໊ؔϦςϥϧͷҧ͍ݕग़ • Editor > Duplicates ͔Βཁઃఆมߋ
ΑΓෳࡶͳॏෳɺ୯७ͳॏෳΛݟ͚ͭΔ • unit ͱ͍͏୯ҐΛಈ͔͢͜ͱͰॏෳͷݟ͔ͭΔ۩߹Λมߋ • units = 2 * number
of statements + number of expressions • σϑΥϧτ45ɻׂͱదͳͳͷͰ߹Θͳ͔ͬͨΒมߋ͢Δɻ • ݴޠ͝ͱʹઃఆՄೳ
ॏෳίʔυΛશ෦ݟ͚ͭΔ • Run Inspection By NameΛ࣮ߦ • Mac ͳΒ ”⌃⌥⇧I”
ɺWinͳΒ ”Ctrl+Shift+Alt+I” • “Duplicated code fragment” Λೖྗ࣮ͯ͠ߦ