Giter Club home page Giter Club logo

Comments (5)

niconoe- avatar niconoe- commented on September 27, 2024 1

The Halstead volume metric can be found in the "Size & Volume" panel. It's on the "Volume" metric.

image

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.

niconoe- avatar niconoe- commented on September 27, 2024 1

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.

toniorganizer avatar toniorganizer commented on September 27, 2024

or have several ways to find out the value of maintainability index?

from phpmetrics.

toniorganizer avatar toniorganizer commented on September 27, 2024

Thank you for the explanation provided. But, what is meant by Halstead volume in this column?

Capture

from phpmetrics.

toniorganizer avatar toniorganizer commented on September 27, 2024

OK, thanks for your explanation, this is very helpful.

from phpmetrics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.