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
950
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
PhpStormで重複コードを一瞬で見つける
第144回PHP勉強会の発表内容です
Yuichi Sugiyama
PRO
November 27, 2019
Transcript
14 slides
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” Λೖྗ࣮ͯ͠ߦ
More Decks by Yuichi Sugiyama
See All by Yuichi Sugiyama
20年以上続く PHP 大規模プロダクトを Kubernetes へ ── クラウド基盤刷新プロジェクトの4年間
oogfranz
PRO
0
600
サイボウズ と Garoon と The PHP Foundation と 私 / Cybozu and Garoon and The PHP Foundation and me
oogfranz
PRO
1
660
可能な限り確実にmkdirを成功させるには / Make mkdir
oogfranz
PRO
0
790
サイボウズ #Garoon 開発チームの 「 完成度低いの歓迎LT大会 」 PHPerKaigi出張版 / Low quality LT in PHPerKaigi 2023
oogfranz
PRO
0
810
20年ものの巨大プロダクトをKubernetesに移行している話 後日談/Garoon on Kubernetes after talk
oogfranz
PRO
0
670
20年ものの巨大プロダクトをKubernetesに移行している話/Garoon on Kubernetes
oogfranz
PRO
0
600
PHPアプリケーションだってモニタリングしたい / Monitoring PHP application
oogfranz
PRO
1
700
効果的な静的解析の CI導入パターンを求めて / Great static analysis with CI
oogfranz
PRO
3
4.2k
Dev-meets-Ops
oogfranz
PRO
1
1.1k
Other Decks in Technology
See All in Technology
Welcome JXL!
dynamis
0
120
Test Impact Analysis を武器に立ち向かう、AI 時代のテスト増加に対するヌーラボのアプローチ / getting-started-datadog-test-impact-analysis
k6s4i53rx
3
420
Taking back control of your AI development
inesmontani
PRO
0
310
PHPで家庭用ゲーム機の専用コントローラーをMIDIデバイスとして扱ってみる
wind111
0
200
New Relicのアラート対応をClaude Codeで自動修正するワークフローを作った話
manabuseki
2
640
ワークフローからハーネスへ — Web フレームワークの作者たちが AI エージェントに向かう理由
azukiazusa1
2
1.1k
[関西Kaggler会 20261113] 続・コミュニティコンペのススメ
nejumi
0
200
OpenTelemetryで変わった 新時代のCloudWatchメトリクス監視
tsukuboshi
0
500
AWS Blocksで AIエージェント作れるの知ってます?
kmiya84377
1
170
信頼性を犠牲にせず、PR マージからデプロイまで人の介入を完全にゼロにするまでの道のり
knwoop
4
2.1k
AWS DevOps Agentの構造から読み解く運用 AI エージェントの設計原則/aws-devops-agent-design-principles
tomoki10
0
280
【Oracle AI SPOTLIGHT ウェビナー】AI時代、狙われるデータと止められない業務をどう守るか?
oracle4engineer
PRO
1
140
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
135
10k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
61k
Ruling the World: When Life Gets Gamed
codingconduct
0
450
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3.1k
Navigating Weather and Climate Data
rabernat
0
600
It's Worth the Effort
3n
188
30k
AI: The stuff that nobody shows you
jnunemaker
PRO
12
1.3k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
1
320
Faster Mobile Websites
deanohume
310
32k
Navigating Team Friction
lara
192
16k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
580
Stop Working from a Prison Cell
hatefulcrawdad
274
21k