Comments (5)
The Halstead volume metric can be found in the "Size & Volume" panel. It's on the "Volume" metric.
The value of the maintainability index can effectively be determined by several formulas. As the original formula gives values on a range that contains INF (infinite number), PhpMetrics uses a scaled ratio that is mainly used by other metric tools.
PhpMetrics also provide the MIwoC, the maintainability index without comments, as when your project has too much comments, even when they're irrelevant, it impacts too hardly the MI giving biaised results.
In every formula used, the Halstead volume metric is used as a variable.
from phpmetrics.
It’s the value of the volume of code according to Halstead’s formula.
The formula is :
V = (N1 + N2) * log2(n1 + n2)
where :
- N1 is the total number of operators (not only mathematical, but also logical)
- N2 is the total number of operands
- n1 is the number of distinct operators
- n2 is the number of distinct operands
For each class, PhpMetrics calculates the volume of code regarding the Halstead’s formula.
On project view, the Halstead’s volume is the average of all classes’ volumes.
Halstead’s volume is not only used in MI calculation, but also for Halstead’s formula about « estimated number of bugs delivered », which is (sort of) B = V / 3000. You want B the lowest as possible, which means you also want V the lowest as possible. And that makes sense: the less number of operators and operands your source code has, the less probability of bugs happen.
from phpmetrics.
or have several ways to find out the value of maintainability index?
from phpmetrics.
Thank you for the explanation provided. But, what is meant by Halstead volume in this column?
from phpmetrics.
OK, thanks for your explanation, this is very helpful.
from phpmetrics.
Related Issues (20)
- Please add assets to latest tag (v2.8.0) HOT 3
- Error in html report HOT 1
- Show error if yaml_parse function does not exists HOT 1
- artifacts/phar has phpmetrics.deb?raw=true HOT 2
- page has invalid html HOT 8
- Wrong LCOM metric when using promoted properties in constructor HOT 3
- Support codeclimate/gitlab JSON report HOT 1
- Quick Start instructions: phpmetrics should run as Bash, not PHP HOT 5
- Formula HOT 7
- Cyclomatic complexity as distribution and overall volume calculation HOT 2
- PHP8 Issue on report-violations HOT 2
- Response for a class (RFC) measure HOT 2
- New project for code analysis
- PHP8 Issue Uncaught TypeError: round() HOT 2
- Add support nikic/php-parser:^5 (dependency for update phpunit:11)
- SMOOTHOPERATIONOFLAW.WEBSITE
- Deprecated messages on PHP 8.1
- Wrong Instability for Abstract classes with inheritance classes
- Prepare for newer PHP versions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpmetrics.