code-metrics

How bad is SLOC (source lines of code) as a metric? [closed]

試著忘記壹切 提交于 2019-12-31 09:20:17
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago . We are documenting our software development process. For technical people, this is pretty easy: iterative development with internal milestones every four weeks, external every 3 months. However, the purpose of this exercise is to expose things for our project management in

Code Metrics Calculation in Visual Studio

点点圈 提交于 2019-12-31 08:07:03
问题 What is the prefered score range for the code metrics calculation for the following Maintainability Index Cyclomatic Complexity Depth of Inheritance class Coupling 回答1: The theoretically optimal values are: Maintainability index: 100. Higher values indicate better maintainability. Cyclomatic complexity: 1. The number of different paths that code can take. Depth of inheritance: 1. The number of class definitions above this one in the inheritance tree, not including interfaces. Class coupling:

Code Metrics Calculation in Visual Studio

早过忘川 提交于 2019-12-31 08:06:07
问题 What is the prefered score range for the code metrics calculation for the following Maintainability Index Cyclomatic Complexity Depth of Inheritance class Coupling 回答1: The theoretically optimal values are: Maintainability index: 100. Higher values indicate better maintainability. Cyclomatic complexity: 1. The number of different paths that code can take. Depth of inheritance: 1. The number of class definitions above this one in the inheritance tree, not including interfaces. Class coupling:

Code Metrics in Visual Studio 2010

天涯浪子 提交于 2019-12-23 08:54:32
问题 I was wondering what options were available with regards to code metrics in Visual Studio 2010. I know there are manual metrics that can be run on your code from within the IDE, but are there any other options? What I'm trying to do is this: My team and I are running Team Foundation Server 2010 and we have automated builds set up as well as notifications/alerts for those builds. The notifications work well, but they give only basic information. The notifications link to a page that give more

CK metrics from C# project with Ndepend

断了今生、忘了曾经 提交于 2019-12-23 04:55:17
问题 I have project for school. Now I need to make from it report of all metrics CK (Chidamber Kemerer metrics). The report has to be like table of all those metrics. Question is how to make it from Ndepend this report which it generates it is not what I am looking for. Please help and say how to do it... maybe some tips, documents or something this is very important... 回答1: Ok, so if we are talking of these Chidamber Kemerer metrics, the NDepend ability to write Code Queries and Rules over LINQ

How to extract a single function from a source file

こ雲淡風輕ζ 提交于 2019-12-22 08:48:07
问题 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 that can extract a function from a .c file, so I can run some automated tests on the function. For example, If I have the function cifs_parse_mount_options() within the file connect.c , I'm seeking a solution that would roughly work like: extract

An error occurred while calculating code metrics

我只是一个虾纸丫 提交于 2019-12-21 04:21:17
问题 Issue description When I tried to run code metrics in Visual Studio 2013 for c# project (Analyze -> Calculate Code Metrics for Solution) I get following error: "an error occurred while calculating code metrics" This error occurred even for the newly created project, so it was not related with some reference issues. Solution To solve this issue I've executed following command as an Administrator: regsvr32 "C:\Program Files (x86)\Common Files\microsoft shared\MSEnv\VsLangproj.olb" Conclusion I

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

穿精又带淫゛_ 提交于 2019-12-20 18:33:18
问题 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 per lines of code (LOC) is the same for programs written in different programming languages or not." 回答1: One possible source would be Les Hatton's 1995 paper

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

倾然丶 夕夏残阳落幕 提交于 2019-12-20 18:31:29
问题 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 per lines of code (LOC) is the same for programs written in different programming languages or not." 回答1: One possible source would be Les Hatton's 1995 paper

Clarifying the manual count of Cyclomatic Complexity

淺唱寂寞╮ 提交于 2019-12-20 03:05:23
问题 Let's assume that we have a code like this: switch(y) { case 1: case 2: case 3: function(); break; case 4: case 5: case 6: function_2(); break; } Can we get the CC value as 6+1 here? Why a value of 1 is added? If the CC value is considered as 7, is that the number of independent paths? What if a fall through scenario is considered above? As only possible two unique paths are there, 2 +1 =3 Which of the above are correct or are the both of them correct? 回答1: As we know, CC = P+1. Here, P =