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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
530
サイボウズ と Garoon と The PHP Foundation と 私 / Cybozu and Garoon and The PHP Foundation and me
oogfranz
PRO
1
630
可能な限り確実にmkdirを成功させるには / Make mkdir
oogfranz
PRO
0
770
サイボウズ #Garoon 開発チームの 「 完成度低いの歓迎LT大会 」 PHPerKaigi出張版 / Low quality LT in PHPerKaigi 2023
oogfranz
PRO
0
780
20年ものの巨大プロダクトをKubernetesに移行している話 後日談/Garoon on Kubernetes after talk
oogfranz
PRO
0
660
20年ものの巨大プロダクトをKubernetesに移行している話/Garoon on Kubernetes
oogfranz
PRO
0
590
PHPアプリケーションだってモニタリングしたい / Monitoring PHP application
oogfranz
PRO
1
690
効果的な静的解析の 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
DevelopersIO 2026 知識の地図を描く ─ オントロジーとは何か?
ishikawa_satoru
1
760
Google Cloud Next Tokyo 26登壇時のスクリプト
recruitengineers
PRO
0
210
The seven pitfalls of AI (revised version)
ufried
0
300
生成AIを使って「人が」考える技術 ― AI時代の人機共想と実践ノウハウ|UNITT AC2026
ishiirikie
0
570
継続的なAIコスト最適化
bgpat
1
250
AI駆動開発、viviONの1年 ── うまくいったこと・いかなかったこと
vivion
0
270
AI駆動開発の時代になったのでトヨタ生産方式から見直す
terurou
4
5k
LocalStack を使ったサーバーレスアプリケーション開発 / Serverless Development with LocalStack
kakakakakku
1
310
実践! SRE × AI - ABEMA における AIOps -
tetsuya28
7
1.7k
今さら理解するウェブフォントver.2026
takanorip
3
410
[2026-09-30]ロックンロールは鳴り止まないっ - 信頼性かまってちゃん - 「データ駆動を投げ捨ててまで。」追いかける信頼性改善に向けた取り組みの話
tosite
0
210
脆弱性診断って、何をしているの? 〜弱点を見つけて、会社の改善につなげるまで〜
keeg
0
690
Featured
See All Featured
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
550
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
How to build a perfect <img>
jonoalderson
1
6.1k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
A better future with KSS
kneath
240
18k
Accessibility Awareness
sabderemane
1
240
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
Scaling GitHub
holman
464
140k
Typedesign – Prime Four
hannesfritz
42
3.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” Λೖྗ࣮ͯ͠ߦ