Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Visual Studio Code Metrics

  • Inicia sesión para ver los comentarios

Visual Studio Code Metrics

  1. 1. Code MetricsWhat are they?Why should I care?Lines of Code (LOC)Cyclomatic ComplexityClass Coupling / Coupling Between Objects (CBO)Depth of Inheritance Tree (DIT)Maintainability IndexUsing the Tool Window
  2. 2. What are they?“[…]a measure of some property of a piece of softwareor its specifications […]”http://en.wikipedia.org/wiki/Software_metric“[…] a set of software measures […]”http://msdn.microsoft.com/en-us/library/bb385914.aspx
  3. 3. Why should I care?Find those areas that are (statistically) more likely toproduce problemsDetermine where to focus limited resourcesUnderstand the current state of a solution / projectKeep track of where we have been and where we aregoing
  4. 4. Lines of Code (LOC)Basic Info Raw count of IL lines Not a good measure by itselfStats N/A when used aloneCode Analysis N/A http://academic.research.microsoft.com/Paper/2101790.aspx
  5. 5. Cyclomatic ComplexityBasic Info Count of decisions More decisions means more errors Used often with LOCStats 10 Suggested upper limitCode Analysis CA1502 Avoid excessive complexity 25 http://www.mccabe.com/pdf/mccabe-nist235r.pdf
  6. 6. 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 codeStats Low Less complex Less reuse of code High More complex More reuse of code 5 or 6 for upper limitCode Analysis CA1501 Avoid excessive inheritance http://www.pitt.edu/~ckemerer/CK%20research%20papers/MetricFor 4 OOD_ChidamberKemerer94.pdf
  7. 7. Class Coupling /Coupling Between Objects (CBO)Basic Info Number of classes a single class usesStats 9 Upper limitCode Analysis CA1506 Avoid excessive class coupling 80 for class 30 for method http://www.pitt.edu/~ckemerer/CK%20research%20papers/MetricForOOD_Chidamber Kemerer94.pdf
  8. 8. Maintainability IndexBasic Info Calculates an index value between 0 and 100 that represents the relative ease of maintaining the codeStats High == good Low == bad Ratings Green (20 – 100) Yellow (10 – 19) Red (0 – 9)Code Analysis CA1505 Avoid unmaintainable code 19 or lower
  9. 9. Using the Tool Window

×