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
2024/11/09 LT 言語化できない人が可読性について考えてみた話
Search
Soku
November 08, 2024
60
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
2024/11/09 LT 言語化できない人が可読性について考えてみた話
Soku
November 08, 2024
Featured
See All Featured
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
520
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.9k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
490
Into the Great Unknown - MozCon
thekraken
41
2.8k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
940
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
480
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
310
Mobile First: as difficult as doing things right
swwweet
225
10k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
450
Transcript
言語化できない人が可読性について 考えてみた話 MoneyForward pay事業本部 Tae.hyunseok(ソク)
1. 背景 2. SonarQubeとは 3. Cognitive Complexity 4. 変数名について はじめ
- 自分の言葉を言語化し話すのが難しい .. - 言語の構造化 - SonarQubeの導入 - SonarQubeから指摘されているコードがまるで私だった。 背景
- コードを分析し、品質を上げてくれる Tool とは?
循環的複雑度 認知的複雑度 🎯 定義: コードの分岐パスの数を測定 🧠 定義: コードの理解のしやすさを測定 📊 計算方法:
• if文: +1 • for/while文: +1 • case文: +1 • &&/||: +1 📈 計算方法: • 基本構造: +1 • ネスト1階層: +2 • ネスト2階層: +3 • else文: +1 ❌ 限界: • ネストの深さを考慮しない • コードの可読性を反映しない • 単純な数値的評価 ✅ 利点: • ネストの影響を考慮 • 人間の理解度を反映 • より実践的な評価 Cognitive complexity Code Smell(Critical)Cognitive Complexity of functions should not be too high
同じ循環的複雑度のコードでも差がある ❗ネストが深い実装 認知的複雑度 : 6 📊 循環的複雑度 : 4 ⭐シンプルな実装
認知的複雑度 : 4 📊 循環的複雑度 : 4
🍺変数名で自分が意図する情報を含む 🍺
変数名は具体的に書くほど良いか 🤔
ありがとうございました。 最後に