What's the code metrics you are using for your source code?
-
Hi, I'm a programmer who is working on a big project, there are 1 million plus LOC of the whole project, those source code are developing for years by hundreds of programmers, but these days, I found there are some code dependency, high coupling, duplication in source codes, there are more code shall be refactoring or rewritten. I want to have a code quality analysis to show what bad or good of our source code before we take action to refactoring or rewriting. We only based on code cycle complexity, duplexity and UT coverage to measure the code quality. I think it's not enough from my personal view. I'd like to know: Is there any code metrics is used in your daily software development regular works? If yes, what are kinds of code metrics you are using? How to analyze the code metrics? And how do you adjust your coding activities from the metrics analysis?
-
Answer:
Yes, source code static analysis is used in our project as well. But I think it's not enough, for example, if we want to know the weather of some day, some times we have to measure the temperature, winds, humidity, pressure etc. some metrics sometimes useless. Quality analysis shall based multiple metrics combination. Is there any good way to follow once you figure out the problems of quality?
Liao-Yuan Zhang at Quora Visit the source
Other answers
For the biggest project I've been on in a long time, we use only one metric, unit test coverage. It's a surprisingly good metric, and not just for the obvious reason (that we're exercising a large part of our code). Poorly written code is difficult to unit test, so it helps keep the engineering and implementation honest as well.
Eric Ruck
In addition to the metrics you already mentioned we use a static code analyzer. The analyzer warns about everything from whitespace (=warning level 1) to severe programming errors (=warning level 5). We aim to have zero warnings at level 4 and 5.
Ulrich Wisser
Related Q & A:
- What's the output from this program using fork() and why?Best solution by Stack Overflow
- What's the Da Vinci Code?Best solution by Yahoo! Answers
- What's the code of San Diego?Best solution by Yahoo! Answers
- What's the code to put text beside a picture for myspace?Best solution by answers.yahoo.com
- What's the code for Direct TV?Best solution by satelliteremotecodes.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.