object

# `doc_metric`

Entity and entity predicates documentation score.

Availability:
`logtalk_load(code_metrics(loader))`
Author: Paulo Moura
Version: 0:13:0
Date: 2022-05-05
Compilation flags:
`static, context_switching_calls`
Imports:
`public` code_metrics_utilities
`public` code_metric
Uses:
list
numberlist
Remarks:

> - Score range: Score is a integer percentage where a 100% score means that all expected documentation information is present.

> - Score weights: The score is split by default between 20% for the entity documentation and 80% for the entity predicates documentation, Can be customized using the predicate `entity_predicates_weights_hook/2`.

> - Score customization: The individual scores of entity `info/1` pairs and predicate `info/2` pairs can be customized using the `entity_info_pair_score_hook/3` and `predicate_info_pair_score_hook/4` predicates.

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

### `entity_predicates_weights_hook/2`

Relative weight between entity documentation and predicates documentation in percentage. The sum of the two values must be equal to 100.

Compilation flags:
`dynamic, multifile`
Template:
`entity_predicates_weights_hook(EntityWeight,PredicatesWeight)`
Mode and number of proofs:
`entity_predicates_weights_hook(?integer,?integer)` - `zero_or_one`

### `entity_info_score_hook/2`

Maximum score for entity `info/1` directives.

Compilation flags:
`dynamic, multifile`
Template:
`entity_info_score_hook(Entity,MaximumScore)`
Mode and number of proofs:
`entity_info_score_hook(?term,?integer)` - `zero_or_one`

### `entity_info_pair_score_hook/3`

Score for relevant entity `info/1` directive pairs. If defined, the `entity_info_score_hook/2` predicate should be defined accordingly.

Compilation flags:
`dynamic, multifile`
Template:
`entity_info_pair_score_hook(Pair,Entity,Score)`
Mode and number of proofs:
`entity_info_pair_score_hook(?callable,?term,?integer)` - `zero_or_more`

### `predicate_mode_score_hook/3`

Maximum score for predicate `mode/2` directives.

Compilation flags:
`dynamic, multifile`
Template:
`predicate_mode_score_hook(Entity,Predicate,MaximumScore)`
Mode and number of proofs:
`predicate_mode_score_hook(?term,?term,?integer)` - `zero_or_more`

### `predicate_mode_score_hook/5`

Score for a predicate `mode/2` directive. If defined, the `predicate_mode_score_hook/3` predicate should be defined accordingly.

Compilation flags:
`dynamic, multifile`
Template:
`predicate_mode_score_hook(Template,Solutions,Entity,Predicate,Score)`
Mode and number of proofs:
`predicate_mode_score_hook(?term,?term,?term,?term,?integer)` - `zero_or_one`

### `predicate_info_score_hook/3`

Maximum score for predicate `info/2` directives.

Compilation flags:
`dynamic, multifile`
Template:
`predicate_info_score_hook(Entity,Predicate,MaximumScore)`
Mode and number of proofs:
`predicate_info_score_hook(?term,?term,?integer)` - `zero_or_one`

### `predicate_info_pair_score_hook/4`

Score for a predicate `info/2` directive pairs. If defined, the `predicate_info_score_hook/3` predicate should be defined accordingly.

Compilation flags:
`dynamic, multifile`
Template:
`predicate_info_pair_score_hook(Pair,Entity,Predicate,Score)`
Mode and number of proofs:
`predicate_info_pair_score_hook(?callable,?term,?term,?integer)` - `zero_or_more`

## Protected predicates

(no local declarations; see entity ancestors if any)

## Private predicates

(no local declarations; see entity ancestors if any)

## Operators

(none)