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
5
votes
1 answer

Running code metrics in builds for TFS 2012

How do I get metrics to run with my builds in TFS 2012? I have not seen any solutions for Code Metrics inside of TFS 2012. Microsoft's Metrics tool appears to only work with TFS 2010. The main things I am looking for are the very things that…
Jonathan Nixon
  • 4,940
  • 5
  • 39
  • 53
5
votes
7 answers

Have you written very long functions? If so, why?

I am writing an academic project about extremely long functions in the Linux kernel. For that purpose, I am looking for examples for real-life functions that are extremely long (few hundreds of lines of code), that you don't consider bad programming…
Adam Matan
  • 128,757
  • 147
  • 397
  • 562
4
votes
4 answers

Use of LOC to determine project size

How many lines of code (LOC) does it take to be considered a large project? How about for just one person writing it? I know this metric is questionable, but there is a significant difference, for a single developer, between 1k and 10k LOC. I…
user34537
4
votes
2 answers

Free java library for Software Metrics

does anyone knows about a (free) java library that can calculate different software metrics given the source code? Thank you in advance.
Elvis
  • 817
  • 1
  • 7
  • 19
4
votes
1 answer

Why cyclomatic complexity of code with `switch` higher than that of with 'if-else'

I have two sample functions TestComplexityIf and TestComplexitySwitch. VisualStudio-2017 'Calculate Code Metrics' tool reports a cyclomatic complexity of 10 for the function with switch statement ad 7 for the one with if-else. I wonder how the…
FaisalM
  • 724
  • 5
  • 18
4
votes
4 answers

Calculate software metrics for PHP projects

I would like to calculate some code metrics for my PHP OOP projects. I try to use some of the tools mentioned in here. But except trail version of Understand, which presents only number of code, comment, blank lines number of classes number of…
Magda
  • 177
  • 3
  • 10
4
votes
1 answer

Metrics from Spring Boot are not showing up in Prometheus

Followed steps given below to send Metrics from Spring Boot to Prometheus: Note: I have installed Prometheus locally on my Mac using a Docker image. In pom.xml added this: org.springframework.boot
DilTeam
  • 2,551
  • 9
  • 42
  • 69
4
votes
2 answers

TFS 2010/Code Metrics Integration, Automated Builds Fail, Code Metrics Don't Run

I'm trying to add an automatic post-build trigger to run NDepend (code metrics software) after an automated team build in TFS 2010. NDepend's website provided code for integrating this capability, and so I have pasted their code into my .csproj file…
AmbiguousX
  • 1,704
  • 4
  • 24
  • 39
4
votes
1 answer

How to view Code Metrics lke Fan-In/Fan-Out with NDepend

I have installed NDepend (14-day trial version) as a Visual Studio 2015 Extension, and it works now. I would like to get some metrics of some classes in my solution: length of identifiers fan in / fan out weighted method of class coupling of class…
VincentZHANG
  • 757
  • 1
  • 13
  • 31
4
votes
0 answers

An error occurred while calculating code metrics for target file

When i do calculate code metrics to my project, i am getting this error below. How can i solve it? Project: AA.Tests.Repository Configuration: Debug Scope: None Assembly: G:\WS\selin\src\Binaries\Win32\bin\AA.Tests.Repository.dll Maintainability…
cell-in
  • 709
  • 2
  • 11
  • 27
4
votes
3 answers

Visual C++ (2012 - 2015) Code Metrics

Are there any tools out there for producing Code Metrics (Such as Cyclomatic Complexity, Lines of Code, Comment to Code Ratio, etc) for Visual C++ 2012/2013 or 2015? We need to be able to run a command-line tool to generate these metrics (And output…
BenS1
  • 183
  • 2
  • 11
4
votes
2 answers

Exclude test code from code metrics

Is it at all possible to exclude Class Libraries or code files from code metrics? I cannot find good resources on this as they all seem to focus on Code Coverage, which can be set in a .runsettings file. I would like to have a build without warnings…
Aage
  • 5,932
  • 2
  • 32
  • 57
4
votes
2 answers

Number of classes in project/workspace

Is there any way to get the number of classes in a project or the complete workspace in Xcode?
ATV
  • 4,116
  • 3
  • 23
  • 42
4
votes
4 answers

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…
epotter
  • 7,631
  • 7
  • 63
  • 88
4
votes
8 answers

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

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…
Kent
  • 43
  • 2