.. index:: code_metrics_utilities
.. _code_metrics_utilities/0:

.. rst-class:: right

**category**

``code_metrics_utilities``
==========================

Internal predicates for analyzing source code.

| **Availability:** 
|    ``logtalk_load(code_metrics(loader))``

| **Author:** Ebrahim Azarisooreh
| **Version:** 0:7:0
| **Date:** 2024-03-28

| **Compilation flags:**
|    ``static``


| **Uses:**
|    :ref:`list <list/0>`
|    :ref:`logtalk <logtalk/0>`

| **Remarks:**

   - Usage: This is meant to be imported by any metric added to the system.
   - Predicate Scope: This is meant for internal use by metrics only. As such, all provided predicates are protected.

| **Inherited public predicates:**
|    (none)

.. contents::
   :local:
   :backlinks: top

Public predicates
-----------------

(no local declarations; see entity ancestors if any)

Protected predicates
--------------------

.. index:: ancestor/4
.. _code_metrics_utilities/0::ancestor/4:

``ancestor/4``
^^^^^^^^^^^^^^

True if ``Entity`` descends from ``Ancestor``, and ``EntityKind`` and ``AncestorKind`` unify with their respective entity types.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``ancestor(EntityKind,Entity,AncestorKind,Ancestor)``
| **Mode and number of proofs:**
|    ``ancestor(?entity,?entity_identifier,?entity,?entity_identifier)`` - ``zero_or_more``


------------

.. index:: current_entity/1
.. _code_metrics_utilities/0::current_entity/1:

``current_entity/1``
^^^^^^^^^^^^^^^^^^^^

True if ``Entity`` is a currently loaded entity.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``current_entity(Entity)``
| **Mode and number of proofs:**
|    ``current_entity(?entity_identifier)`` - ``zero_or_more``


------------

.. index:: declares_predicate/2
.. _code_metrics_utilities/0::declares_predicate/2:

``declares_predicate/2``
^^^^^^^^^^^^^^^^^^^^^^^^

True if ``Entity`` declares ``Predicate`` internally.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``declares_predicate(Entity,Predicate)``
| **Mode and number of proofs:**
|    ``declares_predicate(?entity_identifier,?predicate_indicator)`` - ``zero_or_more``


------------

.. index:: defines_predicate/2
.. _code_metrics_utilities/0::defines_predicate/2:

``defines_predicate/2``
^^^^^^^^^^^^^^^^^^^^^^^

True if ``Entity`` defines an implementation of ``Predicate`` internally. Auxiliary predicates are excluded from results.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``defines_predicate(Entity,Predicate)``
| **Mode and number of proofs:**
|    ``defines_predicate(?entity_identifier,?predicate_indicator)`` - ``zero_or_more``


------------

.. index:: defines_predicate/3
.. _code_metrics_utilities/0::defines_predicate/3:

``defines_predicate/3``
^^^^^^^^^^^^^^^^^^^^^^^

Same as ``defines_predicate/2``, except ``Property`` is unified with a property of the predicate.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``defines_predicate(Entity,Predicate,Property)``
| **Mode and number of proofs:**
|    ``defines_predicate(?entity_identifier,?predicate_indicator,?term)`` - ``zero_or_more``


------------

.. index:: entity_calls/3
.. _code_metrics_utilities/0::entity_calls/3:

``entity_calls/3``
^^^^^^^^^^^^^^^^^^

True if a predicate ``Caller`` within ``Entity`` makes a ``Call``.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``entity_calls(Entity,Caller,Call)``
| **Mode and number of proofs:**
|    ``entity_calls(?entity_identifier,?predicate_indicator,?predicate_indicator)`` - ``zero_or_one``


------------

.. index:: entity_kind/2
.. _code_metrics_utilities/0::entity_kind/2:

``entity_kind/2``
^^^^^^^^^^^^^^^^^

True if ``Kind`` defines ``Entity`` and is one of category, protocol, or object.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``entity_kind(Entity,Kind)``
| **Mode and number of proofs:**
|    ``entity_kind(+entity_identifier,-entity)`` - ``zero_or_one``


------------

.. index:: entity_property/2
.. _code_metrics_utilities/0::entity_property/2:

``entity_property/2``
^^^^^^^^^^^^^^^^^^^^^

True if ``Property`` is a valid property of ``Entity``. Entity can be either a category, a protocol, or an object.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``entity_property(Entity,Property)``
| **Mode and number of proofs:**
|    ``entity_property(+entity_identifier,-term)`` - ``zero_or_more``


------------

.. index:: entity_updates/3
.. _code_metrics_utilities/0::entity_updates/3:

``entity_updates/3``
^^^^^^^^^^^^^^^^^^^^

True if a predicate ``Updater`` within ``Entity`` makes a dynamic update to ``Updated`` (by using e.g. the ``asserta/1`` or ``retract/1`` predicates).

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``entity_updates(Entity,Updater,Updated)``
| **Mode and number of proofs:**
|    ``entity_updates(+entity_identifier,?predicate_indicator,?predicate_indicator)`` - ``zero_or_one``


------------

.. index:: not_excluded_file/3
.. _code_metrics_utilities/0::not_excluded_file/3:

``not_excluded_file/3``
^^^^^^^^^^^^^^^^^^^^^^^

True if the file is not being excluded.

| **Compilation flags:**
|    ``static``

| **Template:**
|    ``not_excluded_file(ExcludedFiles,Path,Basename)``
| **Mode and number of proofs:**
|    ``not_excluded_file(+list(atom),+atom,+atom)`` - ``zero_or_one``


------------

Private predicates
------------------

(no local declarations; see entity ancestors if any)

Operators
---------

(none)

