RadonMetrics/Documentation/source/Plugin_Metrics_Radon.RadonMetrics.CyclomaticComplexityCalculator.html

Wed, 30 Aug 2023 13:20:08 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 30 Aug 2023 13:20:08 +0200
branch
eric7
changeset 109
47df4b69f699
parent 107
0843dd7239f6
child 111
897c71cbc967
permissions
-rw-r--r--

Corrected some code style issues and code documentation.

<!DOCTYPE html>
<html><head>
<title>Plugin_Metrics_Radon.RadonMetrics.CyclomaticComplexityCalculator</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<a NAME="top" ID="top"></a>
<h1>Plugin_Metrics_Radon.RadonMetrics.CyclomaticComplexityCalculator</h1>

<p>
Module implementing the cyclomatic complexity service.
</p>
<h3>Global Attributes</h3>

<table>
<tr><td>None</td></tr>
</table>
<h3>Classes</h3>

<table>
<tr><td>None</td></tr>
</table>
<h3>Functions</h3>

<table>

<tr>
<td><a href="#__cc2Dict">__cc2Dict</a></td>
<td>Private function to convert an object holding cyclomatic complexity results into a dictionary.</td>
</tr>
<tr>
<td><a href="#__cyclomaticComplexity">__cyclomaticComplexity</a></td>
<td>Private function to calculate the cyclomatic complexity for one Python file.</td>
</tr>
<tr>
<td><a href="#__getType">__getType</a></td>
<td>Private function to get the type of an object as a string.</td>
</tr>
<tr>
<td><a href="#batchCyclomaticComplexity">batchCyclomaticComplexity</a></td>
<td>Module function to calculate the cyclomatic complexity for a batch of files.</td>
</tr>
<tr>
<td><a href="#cyclomaticComplexity">cyclomaticComplexity</a></td>
<td>Private function to calculate the cyclomatic complexity of one file.</td>
</tr>
<tr>
<td><a href="#initBatchService">initBatchService</a></td>
<td>Initialize the batch service and return the entry point.</td>
</tr>
<tr>
<td><a href="#initService">initService</a></td>
<td>Initialize the service and return the entry point.</td>
</tr>
<tr>
<td><a href="#workerTask">workerTask</a></td>
<td>Module function acting as the parallel worker for the cyclomatic complexity calculation.</td>
</tr>
</table>
<hr />
<hr />
<a NAME="__cc2Dict" ID="__cc2Dict"></a>
<h2>__cc2Dict</h2>
<b>__cc2Dict</b>(<i>obj</i>)

<p>
    Private function to convert an object holding cyclomatic complexity results
    into a dictionary.
</p>
<dl>

<dt><i>obj</i> (radon.visitors.Function)</dt>
<dd>
object as returned from cc_visit()
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
conversion result
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
dict
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
<hr />
<a NAME="__cyclomaticComplexity" ID="__cyclomaticComplexity"></a>
<h2>__cyclomaticComplexity</h2>
<b>__cyclomaticComplexity</b>(<i>text</i>)

<p>
    Private function to calculate the cyclomatic complexity for one Python
    file.
</p>
<dl>

<dt><i>text</i> (str)</dt>
<dd>
source text
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
tuple containing the result dictionary
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
(tuple of dict)
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
<hr />
<a NAME="__getType" ID="__getType"></a>
<h2>__getType</h2>
<b>__getType</b>(<i>obj</i>)

<p>
    Private function to get the type of an object as a string.
</p>
<dl>

<dt><i>obj</i> (radon.visitors.Function or radon.visitors.Class)</dt>
<dd>
object to be analyzed
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
type string for the object
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
str, one of ["method", "function", "class"]
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
<hr />
<a NAME="batchCyclomaticComplexity" ID="batchCyclomaticComplexity"></a>
<h2>batchCyclomaticComplexity</h2>
<b>batchCyclomaticComplexity</b>(<i>argumentsList, send, fx, cancelled, maxProcesses=0</i>)

<p>
    Module function to calculate the cyclomatic complexity for a batch of
    files.
</p>
<dl>

<dt><i>argumentsList</i> (list)</dt>
<dd>
list of arguments tuples as given for
        cyclomaticComplexity
</dd>
<dt><i>send</i> (function)</dt>
<dd>
reference to send function
</dd>
<dt><i>fx</i> (str)</dt>
<dd>
registered service name
</dd>
<dt><i>cancelled</i> (function)</dt>
<dd>
reference to function checking for a cancellation
</dd>
<dt><i>maxProcesses</i> (int)</dt>
<dd>
number of processes to be used
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
<hr />
<a NAME="cyclomaticComplexity" ID="cyclomaticComplexity"></a>
<h2>cyclomaticComplexity</h2>
<b>cyclomaticComplexity</b>(<i>file, text="", </i>)

<p>
    Private function to calculate the cyclomatic complexity of one file.
</p>
<dl>

<dt><i>file</i> (str)</dt>
<dd>
source filename
</dd>
<dt><i>text</i> (str)</dt>
<dd>
source text
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
tuple containing the result dictionary
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
(tuple of dict)
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
<hr />
<a NAME="initBatchService" ID="initBatchService"></a>
<h2>initBatchService</h2>
<b>initBatchService</b>(<i></i>)

<p>
    Initialize the batch service and return the entry point.
</p>
<dl>
<dt>Return:</dt>
<dd>
the entry point for the background client (function)
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
<hr />
<a NAME="initService" ID="initService"></a>
<h2>initService</h2>
<b>initService</b>(<i></i>)

<p>
    Initialize the service and return the entry point.
</p>
<dl>
<dt>Return:</dt>
<dd>
the entry point for the background client (function)
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
<hr />
<a NAME="workerTask" ID="workerTask"></a>
<h2>workerTask</h2>
<b>workerTask</b>(<i>inputQueue, outputQueue</i>)

<p>
    Module function acting as the parallel worker for the cyclomatic
    complexity calculation.
</p>
<dl>

<dt><i>inputQueue</i> (multiprocessing.Queue)</dt>
<dd>
input queue
</dd>
<dt><i>outputQueue</i> (multiprocessing.Queue)</dt>
<dd>
output queue
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
</body></html>

eric ide

mercurial