Questions tagged [code-metrics]

Software metrics are quantitative data pertaining to source code, e.g. number of lines of code (LOC) for a file.

Questions with this tag will often be about which metrics are most useful for certain purposes or which tools are available to provide certain metrics.

276 questions
4
votes
2 answers

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?
Massimiliano
  • 16,770
  • 10
  • 69
  • 112
4
votes
0 answers

Cane and metric_fu like code metrics for CoffeeScript?

Rails has a lot of easy to use code metric tools like metric_fu, cane etc. Are there any similar tools for CoffeeScript? So far I've found CoffeeLint, which checks for correct coding style. But its feature set is limited to syntax checks.
Sebastian Hoitz
  • 9,343
  • 13
  • 61
  • 77
4
votes
6 answers

How to extract a single function from a source file

I'm working on a small academic research about extremely long and complicated functions in the Linux kernel. I'm trying to figure out if there is a good reason to write 600 or 800 lines-long functions. For that purpose, I would like to find a tool…
Adam Matan
  • 128,757
  • 147
  • 397
  • 562
3
votes
2 answers

ruby code quality checker that could catch debugger statement

I am looking for a ruby code quality checker that could catch or notify if something like a 'debugger' statement gets accidentally committed to ruby code. It would also be ideal if it could look in a rails project and scan any places that may…
Vince
  • 1,441
  • 1
  • 14
  • 19
3
votes
2 answers

Software metrics to identify developers by their coding style

Traditionional software metrics deal with quality of software. I'm looking for metrics that can be used to identify developers by their code, in the same vein as plagiarism software and stylometry can be used to identify authors by their writing…
Adam Schmideg
  • 10,590
  • 10
  • 53
  • 83
3
votes
1 answer

What would be a good way to measure the size of a JSP project?

Given an existing JSP project, I would like to get a feel for the complexity/size of the "view" portion of the project. Here's what I've done so far: Pulled the list of JSP's that have been compiled from the production server within the last x…
Dale
  • 5,520
  • 4
  • 43
  • 79
3
votes
1 answer

C# How to exclude generated code from VS2008 code metrics?

How can I exclude generated code, like Windows Forms Designer related code, from Visual Studio 2008 code metrics? I've been digging around but I didn't found any solution. DebuggerHidden and DebuggerNonUserCode have no effect.
mafu
  • 31,798
  • 42
  • 154
  • 247
3
votes
2 answers

Github repository statistics: Historical data on total contributors for each month for the past x months/years?

Imagine we have following GitHub repository: https://github.com/pytorch/pytorch On the right side of the page, you can see the Used by and Contributors count. Is it possible to get that information on a monthly basis, say for the past x…
Christopher
  • 2,120
  • 7
  • 31
  • 58
3
votes
4 answers

What is (or should be) the cyclomatic complexity of a virtual function call?

Cyclomatic Complexity provides a rough metric for how hard to understand a given function is, or how much potential for containing bugs it has. In the implementations I've read about, usually all of the basic control flow constructs (if, case,…
3
votes
3 answers

Can't locate DateTime.pm

Can't locate DateTime.pm in @INC (you may need to install the DateTime module) I have installed DateTime module with these commands perl -MCPAN -e shell cpan> install DateTime To find out where DateTime was installed I used this command perldoc…
Rifath
  • 31
  • 1
  • 3
3
votes
0 answers

How to measure Fortran Code metrics in Visual studio?

How to measure code metrics (Maintainability Index, Cyclomatic Complexity, etc.) of an Intel visual Fortran project ? We are using Intel Parallel Studio 18 with Visual Studio 2017. The measurement seems possible with other languages.
Prince
  • 31
  • 1
3
votes
2 answers

Open Source Tools to calculate Halstead Complexity metrics for Java file

Are there any open source tools to calculate Halstead Complexity metrics for Java source files.
Salman A. Kagzi
  • 3,833
  • 13
  • 45
  • 64
3
votes
1 answer

nDepend integration in Visual Studio 2010

This stems from a previous question I asked regarding code metrics. I have been trying out nDepend as a tool to use in running metrics on our team's code. I have to say that so far I am very impressed with the design, information given, etc. My…
AmbiguousX
  • 1,704
  • 4
  • 24
  • 39
3
votes
1 answer

Why is the cyclomatic complexity of an event 2?

I'm scrutinizing cyclomatic complexity in an application with the purpose of testing anything that's got a cyclomatic complexity greater than 1. What I'm seeing is that a very simple event's add accessor has a cyclomatic complexity of 2. Why is…
Trevor
  • 4,620
  • 2
  • 28
  • 37
3
votes
3 answers

Does using a map truly reduce cyclomatic complexity?

Suppose I have the original method below. public String someMethod(String str) { String returnStr; if("BLAH".equals(str)) { returnStr="ok"; } else if ("BLING".equals(str)) { returnStr="not ok"; } else if…
jayson
  • 31
  • 2