code-metrics

Do software metrics work both ways

Hi I just started working for a large company. in a recent internal audit, measuring metrics such as Cyclomatic complexity and file sizes it turned out that several modules including the one owned by my team have a very high index. so in the last week we have been all concentrating on lowering these indexes for our code. by re...

Code Metrics Calculation in Visual Studio

What is the prefered score range for the code metrics calculation for the following Maintainability Index Cyclomatic Complexity Depth of Inheritance class Coupling ...

How can one measure the SOLIDness of C# code?

Which metrics are there and which tools exist to measure the SOLIDness of C# code? Or tools to indicate where the principles are violated most harmfully? ...

Code complexity metrics in Java

How to get code complexity metrics for a program? well i wanted to create a program that check and score a code on how complex it is for example how many loop, if statements, if there is any nested loops etc. so for example a code with no loops, or if staement is not complicated. EDIT: note that this question is about code complexity, ...

is there a book overviewing different types of source code metrics ?

Hi I have to submit a paper about the usage of source code metrics in software engineering processes. I thought it would be nice to start by introducing some categorization of source code metrics (for example using plane LOC count Vs doing some static analysis of the code) , but I can't find a book or article that will present the dif...

Is there a standard way to count statements in C#

I was looking at some code length metrics other than Lines of Code. Something that Source Monitor reports is statements. This seemed like a valuable thing to know, but the way Source Monitor counted some things seemed unintuitive. For example, a for statement is one statement, even though it contains a variable definition, a condition, a...

Source of parsers for programming languages?

I'm dusting off an old project of mine which calculates a number of simple metrics about large software projects. One of the metrics is the length of files/classes/methods. Currently my code "guesses" where class/method boundaries are based on a very crude algorithm (traverse the file, maintaining a "current depth" and adjusting it whe...

Metric to measure object-orientedness

Is there a metric that can assist in determining the object-orientedness of a system or application? I've seen some pretty neat metrics in the .NET Reflector Add-ins codeplex project, but nothing like this yet. If such a metric doesn't exist, would it even be possible or useful? There are the 3 supposed tenets of object-oriented programm...

Why Does This Maintainability Index Increase?

I would be appreciative if someone could explain to me the difference between the following two pieces of code in terms of Visual Studio's Code Metrics rules. Why does the Maintainability Index increase slightly if I don't encapsulate everything within using ( )? Sample 1 (MI score of 71) public static String Sha1(String plainText) { ...

Basis for claim that the number of bugs per line of code is constant regardless of the language used

I've heard people say (although I can't recall who in particular) that the number of bugs per line of code is roughly constant regardless of what language is used. What is the research that backs this up? Edited to add: I don't have access to it, but apparently the authors of this paper "asked the question whether the number of bugs pe...

Visual Studio Code Metrics and the Maintainability index of switch case

Hi there! As a person who loves to follow the best practices, If i run code metrics (right click on project name in solution explorer and select "Calculate Code Metrics" - Visual Studio 2010) on: public static string GetFormFactor(int number) { string formFactor = string.Empty; switch (number) { ...

metrics in sonar

http://docs.codehaus.org/display/SONAR/Metric+definitions how can i use metrics in sonar? Is there any plugin for all this metrics? here are plugins but not for all metrics: http://docs.codehaus.org/display/SONAR/Sonar+Plugin+Library/ ...

Tool used to retrieve code metrics in xUnit Test Patterns?

I'm reading xUnit Test Patterns by Gerard Meszaros. On one of the pages he refers to some software metrics: While the need to wrap lines to keep them at 65 characters makes this code look even longer than it really is, it is still unnecessarily long. It contains 25 executable statements including initialized declarations...

Code metrics of php - Notepad++

Hello! In particular, I am interested to know how many lines of codes there are, but this spans across many files. I have been using notepad++ to author the code and for each file it does display line numbers but of course I have empty returns to make the code more readable. Does anyone know of a plugin or tool that I can accurately g...

Good code measuring tools?

Are there any good code measuring tools available? I found code measure pretty useful and interesting, but I don't think I can pay $1K/year for just using the measuring tool. I imagine there might be a tool that is/can open source software language independent OS independent measure the metrics from different categories : LOC, LOC ...

WinForms MenuStrip Isolation to improve Code Maintainability

In Windows Forms, C#, .NET 3.5, VS2008... What's a good way to isolate the code for a MenuStrip (or any complex control group), and it's child menu items, from the rest of my form? For example, when I have a MenuStrip with a number of menus and each menu has a number of menu items, which all have click events, a ton of code is spewed i...

What code metrics\guidline you are using?

I am using code complexity metric, and line of code(per function). This keeping the code short and readable. What code metrics you using? ...

Metric Shader for VS 2010

Has anyone found a Metric Shader type plugin for VS 2010? I was using a really good one in VS 2008 that is a plugin for Dev Express DXCore: Metric Shader But it doesn't work in VS 2010. I found this to be a tremendously handy tool while refactoring and would really like it 2010. Thanks! ...

Supporting Code Metrics with Case Studies

I'm principally interested in case studies on code metrics, relating code readability to defect reduction, that justify taking seriously cyclomatic complexity or some similar metric. Wikipedia has this example: A number of studies have investigated cyclomatic complexity's correlation to the number of defects contained in a mod...

Where is the extension/extensibility point for vs2010 code metrics?

I'd like to extend the 2010 static code analysis metrics (mostly fix it so the rollup is max instead of sum). Where is the extensibility point? Is it an MEF component somewhere? ...