Internal Methods is one of the source-code metrics Understand computes across 17+ languages — browse them in the GUI, export and track them, or script them with the Python API.
Internal Methods
API ID: CountDeclMethodInternalLanguages: C#
Targets: Architectures, Classes, Project
Number of local internal methods.
An internal method (C#'s internal access modifier) is accessible from anywhere in the same assembly, but not from other assemblies.
For example:
namespace MetricsDemo
{
public class AccessModifiers
{
internal int InternalField;
protected internal int ProtectedInternalField;
internal void InternalMethod()
{
InternalField++;
}
protected internal void ProtectedInternalMethod()
{
ProtectedInternalField++;
}
}
}
InternalMethod() is the only internal method, giving CountDeclMethodInternal = 1. ProtectedInternalMethod() is protected internal — a different, broader access level — so it doesn't count here.
See Methods for the total across all access levels, and Protected Internal Methods for the related access level. Public Methods, Protected Methods, and Private Methods cover the access levels shared with C++ and Java, and Default Methods covers Java's package-private methods.
Targets By Language:- C#: Project, Class, Struct
- For projects and architectures, this metric must also be enabled from "Project Configuration/Metrics/Projects and Architectures" with the "Show aggregated class metrics" option. Enabling this option can be time consuming.
- This metric can be disabled from "Project Configuration/Metrics/Object Orientated" with the "Show method and variable count metrics" option.