Papers
Topics
Authors
Recent
Search
2000 character limit reached

Maintained Metric: Definition and Applications

Updated 2 February 2026
  • Maintained metric is a quantitative measure that tracks the persistence and regularity of a system property across time and perturbations.
  • It is applied in various fields such as software engineering for activity analysis, reinforcement learning for state similarity, and graph algorithms for resilience.
  • These metrics combine statistical data, static analysis, and mathematical formulations to provide actionable insights for risk assessment and system improvement.

A maintained metric is a quantitative measure designed to capture the preservation, regularity, or stability of a property—such as code, system state, or algorithmic structure—over time, usage, or after perturbations. The concept pervades fields from software engineering (where it quantifies maintenance activity or software health) to theoretical computer science (where it characterizes robustness of graphs and metric spaces under failures), machine learning (preservation of ordinal/geometric relations), and mathematical physics (preservation of geometric structure under flows or quantization). Definitions and assessment protocols of maintained metrics are domain-specific, but always encode a notion of quantitative tracking of the persistence of a system property subject to modifications, adversarial interventions, or stochastic uncertainty.

1. Maintained Metrics in Software Engineering

In software engineering, “maintained metric” typically refers either to explicit metrics tracking recent maintenance activity (e.g., frequency of updates or issue activity) or to metrics that summarize the maintainability of a codebase as it evolves.

1.1. Activity-Based Maintained Metric

A leading example is the Maintained metric in the OpenSSF Scorecard, quantifying recency and frequency of repository maintenance. Its computation aggregates commit counts and collaborator issue events over a sliding 90-day window, normalized to an integer scale 0–10:

Maintained(t)=round[g(t)×min(10,S^(t))]\text{Maintained}(t) = \mathrm{round} \left[ g(t) \times \min(10, \hat S(t)) \right]

with

S^(t)=10×τ=t89t(C(τ)+I(τ))90/7\hat S(t) = 10 \times \frac{\sum_{\tau = t-89}^{t} \big( C(\tau) + I(\tau) \big)}{90/7}

where C(t)C(t) and I(t)I(t) are daily commits and issue activities respectively, and g(t)g(t) gates for repository existence period. A perfect score of 10 implies sustained activity (at least 1 commit per week over the last 90 days) (Tsakpinis et al., 26 Jan 2026).

The Scorecard Maintained metric is used for both ranking software supply-chain security posture and for proactive risk assessment of package abandonment. Complementary approaches learn a probability of “active maintenance” from diverse features such as issue/pr counts, for example the Level of Maintenance Activity (LMA) metric (Coelho et al., 2020):

LMA=200p100\text{LMA} = 200p - 100

where pp is the random forest probability that a project is "active" (with 0.5p10.5 \leq p \leq 1).

1.2. Maintainability Composite Metrics

Classical maintainability metrics quantify the modifiability, testability, and error-proneness of code at the code, module, or class level. These include:

  • Maintainability Index (MI):

MI=1715.2ln(V)0.23CC16.2ln(LOC)\text{MI} = 171 - 5.2\,\ln(V) - 0.23\,\mathrm{CC} - 16.2\,\ln(\mathrm{LOC})

where VV is Halstead volume, CC\mathrm{CC} is McCabe Cyclomatic Complexity, and LOC\mathrm{LOC} is lines of code (Rychkova et al., 2017, Ronchieri et al., 2017, Molnar et al., 2020).

  • Technical Debt Ratio (TDR):

TDR=total remediation timeestimated creation effort\text{TDR} = \frac{\text{total remediation time}}{\text{estimated creation effort}}

as operationalized by static analysis tools (e.g., SonarQube), directly reflecting fix effort (Molnar et al., 2020).

  • ARiSA Model: Aggregates class-level metric “extremes” weighted by ISO 9126 maintainability sub-characteristics (e.g., analyzability, changeability), using a ranked outlier-based strategy (Molnar et al., 2020).

In practice, maintained metrics for software maintenance are either activity-based (as in OpenSSF Scorecard and LMA), or composite quality indexes aggregating static measurements and tuned thresholds (Ronchieri et al., 2017, Rychkova et al., 2017, Thakur et al., 2014).

2. Algorithmic and Adversarial Maintenance in Metric Spaces

The concept of a “maintained metric” also appears in graph algorithms, particularly in resilient network design.

A prototypical formulation appears in reliable spanner construction, where the dilation/spanner property must be maintained after adversarial node failures:

  • Let (P,d)(P, d) be a finite metric space. A graph G=(P,E)G=(P, E) is a tt-spanner if for all u,vu, v, d(u,v)dG(u,v)td(u,v)d(u, v) \le d_G(u, v) \le t d(u, v).
  • Under adversarial removal BPB \subset P, the spanner property is maintained on PB+P \setminus B^+, where B+BρB|B^+ \setminus B| \le \rho |B|, i.e., outside a small damage set the metric is unchanged up to the prescribed dilation factor (Har-Peled et al., 2020).

This reliability criterion encodes maintenance of metric structure—specifically, the ability to preserve low-distortion pairwise distances—after catastrophic events. The trade-offs studied are size/stretch (efficiency) versus reliability (damage containment).

3. Maintained Metrics in Reinforcement Learning and State Similarity

In reinforcement learning, “maintained metric” refers to a theoretical measure of state similarity that is preserved (or evolves contractively) under the MDP’s dynamics.

  • Bisimulation metrics quantify the behavioral distortion between states and are maintained under composition and abstraction:

d(s,s)=maxaR(s,a)R(s,a)+γWp(P(s,a),P(s,a);d)d(s,s') = \max_{a} |R(s,a) - R(s',a)| + \gamma W_p(P(\cdot|s,a), P(\cdot|s',a); d)

where WpW_p denotes Wasserstein distance on successor distributions, and dd is the ground (pseudo-)metric (Lan et al., 2021).

The maintained metric in this context refers to the fixed-point metric (from a contraction mapping), encoding a stable, canonical notion of behavioral distance for generalization, abstraction, and continuity results in MDP theory.

4. Maintenance of Geometric and Physical Structure

In mathematical physics and differential geometry, “maintenance” of a metric can refer to preservation of metricity (covariant constancy of the metric), integrability, or singularity-avoiding evolution.

  • Metric Measure Spaces: The metricity and integrability of the metric are strictly maintained in metric measure spaces, even under conformal deformations. The covariant derivative is the Levi–Civita connection, so metricity persists (Rahmanpour et al., 2014).
  • Quantum Gravity and Raychaudhuri Flow: The maintenance (or loss) of nonsingularity is quantified by the sign of the Raychaudhuri expansion scalar’s "acceleration" (dθ/dτd\theta/d\tau), with a maintained positive value indicating the persisting absence of singularities. Under metric quantization, the nonsingularity may be either preserved or destroyed depending on the scenario (Tawfik et al., 9 Jun 2025).

5. Maintained Metrics in Metric Learning

In machine learning, especially distance metric learning, “maintaining” a metric can refer to preserving certain properties (ordinal structure, local geometry):

  • Ordinal Distance Metric Learning: Models such as cMDS-DML are explicitly constructed to maintain ordinal relationships among data points (e.g., ranked image relevance) as captured by a learned Mahalanobis metric, where ordinal monotonicity and local geometric structure are jointly optimized (Yu et al., 2019).

These approaches formalize “maintained” as the degree to which pairwise or higher-order relationships are stably preserved after a transformation or learning update.

6. Metrics for Service and API Maintainability

In service-based and microservice architectures, “maintained metric” typically refers to structural properties of interfaces that influence future modifiability, stability, and testability.

  • The RAMA (RESTful API Metric Analyzer) approach computes complexity, cohesion, and size metrics (e.g., Arguments per Operation, Average Path Length, Lack of Message Cohesion), explicitly benchmarking and thresholding against a corpus of real-world APIs to establish actionable color-coded guidance for maintainability (Bogner et al., 2020).

A maintained metric for an API synthesizes interface design regularity and expected maintenance effort, and the thresholds enable early detection of impending design or maintenance problems.

7. Interpretation, Use, and Limitations

Maintained metrics are essential for:

  • Early warning and tracking of design debt,
  • Tool-supported decision-making (refactoring, prioritization),
  • Proactive risk assessment (e.g., in software supply-chain security),
  • Formal abstraction and theoretical robustness (in algorithms and RL),
  • Empirical benchmarking and process monitoring (e.g., open API ecosystems).

Limitations are domain- and metric-specific: most codebase metrics are insensitive to semantic change; activity metrics can be gamed or lag real maintainability; coverage and thresholding generally reflect historical, not prospective, system behavior. Composite indexes are practical for overview but may obscure granular or local degradations. All maintained metrics require periodic empirical recalibration and contextual interpretation, and should be integrated into continuous monitoring and modeling frameworks for maximal value (Coelho et al., 2020, Rychkova et al., 2017, Bogner et al., 2020, Tsakpinis et al., 26 Jan 2026, Lan et al., 2021).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Maintained Metric.