SlideShare ist ein Scribd-Unternehmen logo
1 von 12
Code Metrics
What are they?

Why should I care?

Lines of Code (LOC)

Cyclomatic Complexity

Class Coupling / Coupling Between Objects (CBO)

Depth of Inheritance Tree (DIT)

Maintainability Index

Using the Tool Window
What are they?

“[…]a measure of some property of a piece of software
or its specifications […]”
http://en.wikipedia.org/wiki/Software_metric




“[…] a set of software measures […]”
http://msdn.microsoft.com/en-us/library/bb385914.aspx
Why should I care?
Find those areas that are (statistically) more likely to
produce problems

Determine where to focus limited resources

Understand the current state of a solution / project

Keep track of where we have been and where we are
going
Lines of Code (LOC)
Basic Info
  Raw count of IL lines
  Not a good measure by itself


Stats
  N/A when used alone


Code Analysis
  N/A

                          http://academic.research.microsoft.com/Paper/2101790.aspx
Cyclomatic Complexity
Basic Info
   Count of decisions
   More decisions means
   more errors
   Used often with LOC

Stats
   10
   Suggested upper limit

Code Analysis
   CA1502
   Avoid excessive complexity
   25


                                http://www.mccabe.com/pdf/mccabe-nist235r.pdf
Depth of Inheritance (DIT)
Basic Info
   The maximum length from the node to the root of the inheritance tree
   Three assumptions
     Deeper == harder to predict behavior
     Deeper == greater design complexity
     Deeper == more reuse of code


Stats
   Low
      Less complex
      Less reuse of code
   High
      More complex
      More reuse of code
   5 or 6 for upper limit


Code Analysis
   CA1501
   Avoid excessive inheritance
                                           http://www.pitt.edu/~ckemerer/CK%20research%20papers/MetricFor
   4                                       OOD_ChidamberKemerer94.pdf
Class Coupling /
Coupling Between Objects (CBO)
Basic Info
  Number of classes a
  single class uses


Stats
  9
  Upper limit


Code Analysis
  CA1506
  Avoid excessive class coupling
  80 for class
  30 for method                    http://www.pitt.edu/~ckemerer/CK%20research%20papers/MetricForOOD_Chidamber
                                   Kemerer94.pdf
Maintainability Index
Basic Info
   Calculates an index value between 0 and 100 that represents the relative
   ease of maintaining the code


Stats
   High == good
   Low == bad
   Ratings
        Green (20 – 100)
        Yellow (10 – 19)
        Red (0 – 9)


Code Analysis
   CA1505
   Avoid unmaintainable code
   19 or lower
Using the Tool Window
Visual Studio Code Metrics

Weitere ähnliche Inhalte

Andere mochten auch

Presentation Final
Presentation Final Presentation Final
Presentation Final Oylum Boran
 
Thesis presentation1
Thesis presentation1Thesis presentation1
Thesis presentation1Johuang86
 
Systemic Design Principles & Methods (Royal College of Art)
Systemic Design Principles & Methods (Royal College of Art)Systemic Design Principles & Methods (Royal College of Art)
Systemic Design Principles & Methods (Royal College of Art)Peter Jones
 
Thesis - Social Module
Thesis - Social ModuleThesis - Social Module
Thesis - Social ModuleKelly Nichols
 
Film institute and film studious
Film institute and film studiousFilm institute and film studious
Film institute and film studiousTanzil Faraz
 
NATIONAL INSITUTE OF DESIGN
NATIONAL INSITUTE OF DESIGN NATIONAL INSITUTE OF DESIGN
NATIONAL INSITUTE OF DESIGN Ar Naveen Naveen
 
Hotel Design - Midpoint Thesis Book
Hotel Design - Midpoint Thesis BookHotel Design - Midpoint Thesis Book
Hotel Design - Midpoint Thesis Bookrajensen00
 

Andere mochten auch (8)

Presentation Final
Presentation Final Presentation Final
Presentation Final
 
Thesis presentation1
Thesis presentation1Thesis presentation1
Thesis presentation1
 
Systemic Design Principles & Methods (Royal College of Art)
Systemic Design Principles & Methods (Royal College of Art)Systemic Design Principles & Methods (Royal College of Art)
Systemic Design Principles & Methods (Royal College of Art)
 
Thesis - Social Module
Thesis - Social ModuleThesis - Social Module
Thesis - Social Module
 
Thesis on film studio
Thesis on film studioThesis on film studio
Thesis on film studio
 
Film institute and film studious
Film institute and film studiousFilm institute and film studious
Film institute and film studious
 
NATIONAL INSITUTE OF DESIGN
NATIONAL INSITUTE OF DESIGN NATIONAL INSITUTE OF DESIGN
NATIONAL INSITUTE OF DESIGN
 
Hotel Design - Midpoint Thesis Book
Hotel Design - Midpoint Thesis BookHotel Design - Midpoint Thesis Book
Hotel Design - Midpoint Thesis Book
 

Ähnlich wie Visual Studio Code Metrics

Security Application for Malicious Code Detection using Data Mining
Security Application for Malicious Code Detection using Data MiningSecurity Application for Malicious Code Detection using Data Mining
Security Application for Malicious Code Detection using Data MiningPravinYalameli
 
UNCOVER DATA SECURITY BLIND SPOTS IN YOUR CLOUD, BIG DATA & DEVOPS ENVIRONMENT
UNCOVER DATA SECURITY BLIND SPOTS IN YOUR CLOUD, BIG DATA & DEVOPS ENVIRONMENTUNCOVER DATA SECURITY BLIND SPOTS IN YOUR CLOUD, BIG DATA & DEVOPS ENVIRONMENT
UNCOVER DATA SECURITY BLIND SPOTS IN YOUR CLOUD, BIG DATA & DEVOPS ENVIRONMENTUlf Mattsson
 
Data Security In Relational Database Management System
Data Security In Relational Database Management SystemData Security In Relational Database Management System
Data Security In Relational Database Management SystemCSCJournals
 
“Lights Out”Configuration using Tivoli Netcool AutoDiscovery Tools
“Lights Out”Configuration using Tivoli Netcool AutoDiscovery Tools“Lights Out”Configuration using Tivoli Netcool AutoDiscovery Tools
“Lights Out”Configuration using Tivoli Netcool AutoDiscovery ToolsAntonio Rolle
 
2.2 decision tree
2.2 decision tree2.2 decision tree
2.2 decision treeKrish_ver2
 
2020 09-16-ai-engineering challanges
2020 09-16-ai-engineering challanges2020 09-16-ai-engineering challanges
2020 09-16-ai-engineering challangesIvica Crnkovic
 
HospETL - Delivering a Healthcare Analytics Platform
HospETL - Delivering a Healthcare Analytics PlatformHospETL - Delivering a Healthcare Analytics Platform
HospETL - Delivering a Healthcare Analytics PlatformAngela Razzell
 
Detecting Malicious SSL Certificates Using Machine Learning - 2017 B-Sides DC
Detecting Malicious SSL Certificates Using Machine Learning - 2017 B-Sides DCDetecting Malicious SSL Certificates Using Machine Learning - 2017 B-Sides DC
Detecting Malicious SSL Certificates Using Machine Learning - 2017 B-Sides DCKhaled Al-Hassanieh
 
Application of Machine Learning in Cybersecurity
Application of Machine Learning in CybersecurityApplication of Machine Learning in Cybersecurity
Application of Machine Learning in CybersecurityPratap Dangeti
 
Detecting Hacks: Anomaly Detection on Networking Data
Detecting Hacks: Anomaly Detection on Networking DataDetecting Hacks: Anomaly Detection on Networking Data
Detecting Hacks: Anomaly Detection on Networking DataJames Sirota
 
Introduction to Big Data & Hadoop
Introduction to Big Data & HadoopIntroduction to Big Data & Hadoop
Introduction to Big Data & HadoopEdureka!
 
Deep Convolutional Neural Network based Intrusion Detection System
Deep Convolutional Neural Network based Intrusion Detection SystemDeep Convolutional Neural Network based Intrusion Detection System
Deep Convolutional Neural Network based Intrusion Detection SystemSri Ram
 
2010.hari_kannan.phd_thesis.slides.pdf
2010.hari_kannan.phd_thesis.slides.pdf2010.hari_kannan.phd_thesis.slides.pdf
2010.hari_kannan.phd_thesis.slides.pdfAlexKarasulu1
 
Practical Data Communications & Networking for Engineers & Technicians
Practical Data Communications & Networking for Engineers & Technicians Practical Data Communications & Networking for Engineers & Technicians
Practical Data Communications & Networking for Engineers & Technicians Living Online
 
IRJET - A Secure AMR Stganography Scheme based on Pulse Distribution Mode...
IRJET -  	  A Secure AMR Stganography Scheme based on Pulse Distribution Mode...IRJET -  	  A Secure AMR Stganography Scheme based on Pulse Distribution Mode...
IRJET - A Secure AMR Stganography Scheme based on Pulse Distribution Mode...IRJET Journal
 
ISWC 19 - On the Use of Cloud and Semantic Web Technologies for Generative De...
ISWC 19 - On the Use of Cloud and Semantic Web Technologies for Generative De...ISWC 19 - On the Use of Cloud and Semantic Web Technologies for Generative De...
ISWC 19 - On the Use of Cloud and Semantic Web Technologies for Generative De...Daniel Mercier
 
Detecting Hacks: Anomaly Detection on Networking Data
Detecting Hacks: Anomaly Detection on Networking DataDetecting Hacks: Anomaly Detection on Networking Data
Detecting Hacks: Anomaly Detection on Networking DataDataWorks Summit
 

Ähnlich wie Visual Studio Code Metrics (20)

Security Application for Malicious Code Detection using Data Mining
Security Application for Malicious Code Detection using Data MiningSecurity Application for Malicious Code Detection using Data Mining
Security Application for Malicious Code Detection using Data Mining
 
UNCOVER DATA SECURITY BLIND SPOTS IN YOUR CLOUD, BIG DATA & DEVOPS ENVIRONMENT
UNCOVER DATA SECURITY BLIND SPOTS IN YOUR CLOUD, BIG DATA & DEVOPS ENVIRONMENTUNCOVER DATA SECURITY BLIND SPOTS IN YOUR CLOUD, BIG DATA & DEVOPS ENVIRONMENT
UNCOVER DATA SECURITY BLIND SPOTS IN YOUR CLOUD, BIG DATA & DEVOPS ENVIRONMENT
 
Data Security In Relational Database Management System
Data Security In Relational Database Management SystemData Security In Relational Database Management System
Data Security In Relational Database Management System
 
“Lights Out”Configuration using Tivoli Netcool AutoDiscovery Tools
“Lights Out”Configuration using Tivoli Netcool AutoDiscovery Tools“Lights Out”Configuration using Tivoli Netcool AutoDiscovery Tools
“Lights Out”Configuration using Tivoli Netcool AutoDiscovery Tools
 
2.2 decision tree
2.2 decision tree2.2 decision tree
2.2 decision tree
 
2020 09-16-ai-engineering challanges
2020 09-16-ai-engineering challanges2020 09-16-ai-engineering challanges
2020 09-16-ai-engineering challanges
 
HospETL - Delivering a Healthcare Analytics Platform
HospETL - Delivering a Healthcare Analytics PlatformHospETL - Delivering a Healthcare Analytics Platform
HospETL - Delivering a Healthcare Analytics Platform
 
Detecting Malicious SSL Certificates Using Machine Learning - 2017 B-Sides DC
Detecting Malicious SSL Certificates Using Machine Learning - 2017 B-Sides DCDetecting Malicious SSL Certificates Using Machine Learning - 2017 B-Sides DC
Detecting Malicious SSL Certificates Using Machine Learning - 2017 B-Sides DC
 
Application of Machine Learning in Cybersecurity
Application of Machine Learning in CybersecurityApplication of Machine Learning in Cybersecurity
Application of Machine Learning in Cybersecurity
 
Detecting Hacks: Anomaly Detection on Networking Data
Detecting Hacks: Anomaly Detection on Networking DataDetecting Hacks: Anomaly Detection on Networking Data
Detecting Hacks: Anomaly Detection on Networking Data
 
Introduction to Big Data & Hadoop
Introduction to Big Data & HadoopIntroduction to Big Data & Hadoop
Introduction to Big Data & Hadoop
 
Deep Convolutional Neural Network based Intrusion Detection System
Deep Convolutional Neural Network based Intrusion Detection SystemDeep Convolutional Neural Network based Intrusion Detection System
Deep Convolutional Neural Network based Intrusion Detection System
 
Code Metrics
Code MetricsCode Metrics
Code Metrics
 
2010.hari_kannan.phd_thesis.slides.pdf
2010.hari_kannan.phd_thesis.slides.pdf2010.hari_kannan.phd_thesis.slides.pdf
2010.hari_kannan.phd_thesis.slides.pdf
 
Practical Data Communications & Networking for Engineers & Technicians
Practical Data Communications & Networking for Engineers & Technicians Practical Data Communications & Networking for Engineers & Technicians
Practical Data Communications & Networking for Engineers & Technicians
 
Deep learning in manufacturing predicting and preventing manufacturing defect...
Deep learning in manufacturing predicting and preventing manufacturing defect...Deep learning in manufacturing predicting and preventing manufacturing defect...
Deep learning in manufacturing predicting and preventing manufacturing defect...
 
Jurassic Pcap
Jurassic PcapJurassic Pcap
Jurassic Pcap
 
IRJET - A Secure AMR Stganography Scheme based on Pulse Distribution Mode...
IRJET -  	  A Secure AMR Stganography Scheme based on Pulse Distribution Mode...IRJET -  	  A Secure AMR Stganography Scheme based on Pulse Distribution Mode...
IRJET - A Secure AMR Stganography Scheme based on Pulse Distribution Mode...
 
ISWC 19 - On the Use of Cloud and Semantic Web Technologies for Generative De...
ISWC 19 - On the Use of Cloud and Semantic Web Technologies for Generative De...ISWC 19 - On the Use of Cloud and Semantic Web Technologies for Generative De...
ISWC 19 - On the Use of Cloud and Semantic Web Technologies for Generative De...
 
Detecting Hacks: Anomaly Detection on Networking Data
Detecting Hacks: Anomaly Detection on Networking DataDetecting Hacks: Anomaly Detection on Networking Data
Detecting Hacks: Anomaly Detection on Networking Data
 

Kürzlich hochgeladen

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 

Kürzlich hochgeladen (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

Visual Studio Code Metrics

  • 1.
  • 2.
  • 3. Code Metrics What are they? Why should I care? Lines of Code (LOC) Cyclomatic Complexity Class Coupling / Coupling Between Objects (CBO) Depth of Inheritance Tree (DIT) Maintainability Index Using the Tool Window
  • 4. What are they? “[…]a measure of some property of a piece of software or its specifications […]” http://en.wikipedia.org/wiki/Software_metric “[…] a set of software measures […]” http://msdn.microsoft.com/en-us/library/bb385914.aspx
  • 5. Why should I care? Find those areas that are (statistically) more likely to produce problems Determine where to focus limited resources Understand the current state of a solution / project Keep track of where we have been and where we are going
  • 6. Lines of Code (LOC) Basic Info Raw count of IL lines Not a good measure by itself Stats N/A when used alone Code Analysis N/A http://academic.research.microsoft.com/Paper/2101790.aspx
  • 7. Cyclomatic Complexity Basic Info Count of decisions More decisions means more errors Used often with LOC Stats 10 Suggested upper limit Code Analysis CA1502 Avoid excessive complexity 25 http://www.mccabe.com/pdf/mccabe-nist235r.pdf
  • 8. Depth of Inheritance (DIT) Basic Info The maximum length from the node to the root of the inheritance tree Three assumptions Deeper == harder to predict behavior Deeper == greater design complexity Deeper == more reuse of code Stats Low Less complex Less reuse of code High More complex More reuse of code 5 or 6 for upper limit Code Analysis CA1501 Avoid excessive inheritance http://www.pitt.edu/~ckemerer/CK%20research%20papers/MetricFor 4 OOD_ChidamberKemerer94.pdf
  • 9. Class Coupling / Coupling Between Objects (CBO) Basic Info Number of classes a single class uses Stats 9 Upper limit Code Analysis CA1506 Avoid excessive class coupling 80 for class 30 for method http://www.pitt.edu/~ckemerer/CK%20research%20papers/MetricForOOD_Chidamber Kemerer94.pdf
  • 10. Maintainability Index Basic Info Calculates an index value between 0 and 100 that represents the relative ease of maintaining the code Stats High == good Low == bad Ratings Green (20 – 100) Yellow (10 – 19) Red (0 – 9) Code Analysis CA1505 Avoid unmaintainable code 19 or lower
  • 11. Using the Tool Window

Hinweis der Redaktion

  1. http://www.amazon.com/Coding-Faster-Getting-Productive-Microsoft/dp/0735649928/
  2. CA1502http://msdn.microsoft.com/en-us/library/ms182212.aspx
  3. CA1501http://msdn.microsoft.com/en-us/library/ms182213.aspx
  4. CA1506http://msdn.microsoft.com/en-us/library/bb397994.aspxhttp://blogs.msdn.com/b/codeanalysis/archive/2007/11/15/code-metrics-as-check-in-policy.aspx
  5. CA1506http://msdn.microsoft.com/en-us/library/bb397994.aspxhttp://blogs.msdn.com/b/codeanalysis/archive/2007/11/15/code-metrics-as-check-in-policy.aspx