wmc_metric — Logtalk 3.100.1

object

# `wmc_metric`

Weighted Methods per Class (WMC) metric. Uses unit weights, i.e., the score is the number of locally defined (non-auxiliary) predicates. Protocols are not scored as they cannot define predicates. The score is represented by a non-negative integer.

Availability:
`logtalk_load(code_metrics(loader))`
Author: Paulo Moura
Version: 1:0:0
Date: 2026-03-13
Compilation flags:
`static, context_switching_calls`
Imports:
`public` code_metrics_utilities
`public` code_metric
Provides:
logtalk::message_tokens//2
Uses:
list
logtalk
numberlist
Remarks:

> - Unit weights: Each predicate is assigned a weight of 1. A cyclomatic-complexity-weighted variant is not provided as the Logtalk reflection API does not expose intra-clause branching structure (if-then-else, disjunction), which would produce the same approximations as the `cc_metric`.

> - Interpretation: Higher scores indicate an entity with more responsibilities that may benefit from being split.

> - Aggregation: When computing scores for files, directories, and libraries, the individual entity scores are summed.

Inherited public predicates:
all/0 all/1 all_score/1 check_option/1 check_options/1 default_option/1 default_options/1 directory/1 directory/2 directory_score/2 entity/1 entity_score/2 file/1 file/2 file_score/2 format_entity_score//2 library/1 library/2 library_score/2 option/2 option/3 rdirectory/1 rdirectory/2 rdirectory_score/2 rlibrary/1 rlibrary/2 rlibrary_score/2 valid_option/1 valid_options/1

## Public predicates

(no local declarations; see entity ancestors if any)

## Protected predicates

(no local declarations; see entity ancestors if any)

## Private predicates

(no local declarations; see entity ancestors if any)

## Operators

(none)