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
静的解析ではじめる負債コード解消
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
daiki1020
December 14, 2020
Programming
5.3k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
静的解析ではじめる負債コード解消
daiki1020
December 14, 2020
Other Decks in Programming
See All in Programming
技術的負債を組織課題として解く-増えすぎたマイクロサービスとの戦い-
reimaru
1
2k
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
140
スマート反転とウェブアクセシビリティ
camiha
0
210
iOSDC2026登壇資料.pdf
riofujimon
0
170
マイコン向けの軽量Ruby「PicoRuby」で各種デバイスを制御するネイティブアプリの実現手法
bash0c7
0
410
GraphRAGのKnowledge Graphを 直接!見る/View-GraphRAG's-KnowledgeGraph-directly!
tyumugi1113
1
340
Webの地図
yosuke_furukawa
PRO
6
4.6k
速習iPhone Duo対応
yuukiw00w
1
600
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
190
TiDB Cloudのカスタムコントローラーによるオートスケール対応
takaidohigasi
0
130
アクセシビリティから考える情報設計
high_g_engineer
0
380
市販E-Readerを乗っ取れ 〜Embedded Swiftで電子ペーパーガジェットを制御する〜
trickart
0
190
Featured
See All Featured
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.2k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
4 Signs Your Business is Dying
shpigford
187
23k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
280
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
530
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
570
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
700
Heart Work Chapter 1 - Part 1
lfama
PRO
10
36k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
230
Transcript
静的解析からはじめる 負債コード解消 株式会社ラクス 藤岡大樹
自己紹介 株式会社ラクス 開発本部 楽楽販売・労務開発課 藤岡大樹 入社3年目 業務内容:機能開発 サポート 上流設計 など
クラウド型販売管理システム 導入社数1,000社超 10年以上続くサービス Webデータベース ブラウザを使ってCRUDができる
販売管理業務など用途に特化したDBを作れる 構成 PHP + PostgreSQL
課題 長年続くサービスになると… 未使用の関数が放置 コメントと処理が違う そもそもコメントがない 1つの関数の役割が多い …
可読性の低下 開発効率が下がる
デグレコワイ 呼び出し元を辿っていくと 「これ使ってないやん」 関係ないと思ってたのに 共通ロジックなってるやん。。。 今の開発規約と合ってなくて 読みにくい
デグレコワイ 呼び出し元を辿っていくと 「これ使ってないやん」 関係ないと思ってたのに 共通ロジックなってるやん。。。 今の開発規約と合ってなくて 読みにくい 見送ろっか…
静的解析ではじめる負債コード解消 inspection 機能開発で触ったファイル内の検知箇所を併せて修正する
Inspectionってなに? 多くのテンプレートが用意されていてエラーレベルを選ぶだけ テンプレートを元に自分用にカスタマイズも可能!
Inspection活用事例① 未使用の変数や関数を検知 Settings > inspections ◦ PHP ◦ Unused ◦
Unused local variable ◦ Unused private method
Inspection活用事例② コメントがない関数を検知 Settings > inspections ◦ PHP ◦ PHPDocs ◦
Missing PHPDoc comment
Inspection活用事例③ 引数の数が一致していない 関数呼び出しを検知 Settings > inspections ◦ PHP ◦ Type
compatibility ◦ Parameter type
Inspection活用事例④ 自分でカスタマイズして検知 例)条件式の曖昧な比較(==)を検知したい! Settings > inspections ◦ General ◦ Structual
Search Inspection デモ
Inspection活用事例④ 自分でカスタマイズして検知(デモ内容) 例)条件式の曖昧な比較(==)を検知したい! 1. Optionsに追加する
Inspection活用事例④ 自分でカスタマイズして検知(デモ内容) 例)条件式の曖昧な比較(==)を検知したい! 2. 検知したい内容を入力する ◦ テンプレートをもとにカスタマイズもできる
Inspection活用事例④ 自分でカスタマイズして検知(デモ内容) 例)条件式の曖昧な比較(==)を検知したい! 3. テンプレート名を決める 4. 完了
結果 検知箇所を一気に修正するのではなく、触ったファイルと一緒に 修正することで効率を向上できた 余計なファイルを改めで査読する必要もなく、そこまで開発作業の影響に ならない 少しずつ着実に負債コードを減らせている すべてが解消するには時間がかかるが、デグレを起こさないよう慎重に
まとめ 自分たちで強いルールを作ることで負債コードが放置されるのを 防ぐよう工夫した PhpStormだけでも多様な静的解析ができる カスタマイズが可能なのでチーム特有のチェックができる みなさんも自分たちのルールを もう一度見直してみてはいかかでしょうか?
ご清聴 ありがとうございました