FINDING TOXIC CODE
Experiences and techniques for finding dangerous code in large multi-language codebases Kornelis (Korny) Sietsma - @kornys on Twitter
FINDING TOXIC CODE Experiences and techniques for finding dangerous - - PowerPoint PPT Presentation
FINDING TOXIC CODE Experiences and techniques for finding dangerous code in large multi-language codebases Kornelis (Korny) Sietsma - @kornys on Twitter WHO AM I? 2 WHAT DO I DO NOW? Consulting, Delivery, Agile, Technical excellence And the
Experiences and techniques for finding dangerous code in large multi-language codebases Kornelis (Korny) Sietsma - @kornys on Twitter
WHO AM I?
2
WHAT DO I DO NOW?
3
This story is true. Only the facts have been changed to protect the innocent.
4
FISHCORP HAD A PROBLEM
5
YOU HAVE TWO WEEKS
6
”TOXIC” CODE - ERIK DÖRNENBURG BLOG 2008
7
https://erik.doernenburg.com/2008/11/how-toxic-is-your-code/
CODECITY
8
GRAVEYARD OF TOOLS
9
WHAT ABOUT SONARQUBE?
10
HOW ABOUT REALLY LIGHTWEIGHT TOOLS?
11
12
13
ARCHITECTURE
14
FishNet SquidNet
Batch + Optimisation Fishing DB Web API Data Warehouse Batch Tasks Squid DB UI - AngularJS, CSS, HTML, custom JS UI - HTML, CSS, JS, ASPX, C# Mobile “Business Logic” C# Stored Procedures Data Data Stored Procedures
Component Component Component Component Component Component Component ComponentETL SQL Reporting
HOW BIG IS TOO BIG?
15
http://bovon.org/archives/350
Si Simple cross-lan languag age e code
ell 1: To Too m many l lines o
code
16
(LINES OF CODE - BETTER VIEWED IN THE APP!)
17
CODE-MAAT – SCM-BASED INFORMATION
18
https://github.com/adamtornhill/code-maat
Si Simple cross-lan languag age e code
ell 2: To Too f few a authors
19
AUTHORS – BETTER VIEWED IN THE APP
20
Si Simple cross-lan languag age e code
ell 3: To Too l little c change
21
OPINIONS MAY DIFFER!
refactorings, they make changes.
lurking undiscovered bugs. Either way, over time, collective knowledge drops to zero.
into a standalone library, with a lot of automated tests.
22
AGE – BETTER SHOWN IN THE APP
23
HOW ABOUT IDENTIFYING COMPLEXITY?
24
Si Simple cross-lan languag age e code
ell 4: Using code indentation as a proxy xy for complexi xity
25
26
HOW DO OTHER PROJECTS LOOK?
27
OTHER AREAS TO EXPLORE
28
RELEASE TIME - DETAILS
29
RELEASE TIME – LONG TERM TRENDS
30
WHAT DID WE TELL FISHCORP?
31
Simple code smell summary:
Co Code will (eventu tually) be at t gi github.com/ko kornysietsma Tw Twitter: @ko kornys Em Email: ko korny@thoughtworks.com
IMAGE CREDITS
Fanfold Paper – Arnold Reinhold (via WikiMedia) HP-85 computer – Wolfgang Stief (via WikiMedia) James Lewis’ Head - @boicy on Twitter Your Code as a Crime Scene cover – Pragmatic Programmers
33