RadonMetrics/Documentation/source/Plugin_Metrics_Radon.RadonMetrics.RawMetricsDialog.html

Tue, 10 Dec 2024 15:48:54 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 10 Dec 2024 15:48:54 +0100
branch
eric7
changeset 126
9ecce748f0ac
parent 111
897c71cbc967
permissions
-rw-r--r--

Updated copyright for 2025.

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

<p>
Module implementing a dialog to show raw code metrics.
</p>
<h3>Global Attributes</h3>

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

<table>

<tr>
<td><a href="#RawMetricsDialog">RawMetricsDialog</a></td>
<td>Class implementing a dialog to show raw code metrics.</td>
</tr>
</table>
<h3>Functions</h3>

<table>
<tr><td>None</td></tr>
</table>
<hr />
<hr />
<a NAME="RawMetricsDialog" ID="RawMetricsDialog"></a>
<h2>RawMetricsDialog</h2>

<p>
    Class implementing a dialog to show raw code metrics.
</p>
<h3>Derived from</h3>
QDialog, Ui_RawMetricsDialog
<h3>Class Attributes</h3>

<table>
<tr><td>FilePathRole</td></tr>
</table>
<h3>Class Methods</h3>

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

<table>

<tr>
<td><a href="#RawMetricsDialog.__init__">RawMetricsDialog</a></td>
<td>Constructor</td>
</tr>
<tr>
<td><a href="#RawMetricsDialog.__batchFinished">__batchFinished</a></td>
<td>Private slot handling the completion of a batch job.</td>
</tr>
<tr>
<td><a href="#RawMetricsDialog.__cancel">__cancel</a></td>
<td>Private method to cancel the current check run.</td>
</tr>
<tr>
<td><a href="#RawMetricsDialog.__createErrorItem">__createErrorItem</a></td>
<td>Private slot to create a new error item in the result list.</td>
</tr>
<tr>
<td><a href="#RawMetricsDialog.__createResultItem">__createResultItem</a></td>
<td>Private slot to create a new item in the result list.</td>
</tr>
<tr>
<td><a href="#RawMetricsDialog.__createSummary">__createSummary</a></td>
<td>Private method to create the code metrics summary.</td>
</tr>
<tr>
<td><a href="#RawMetricsDialog.__createSummaryItem">__createSummaryItem</a></td>
<td>Private slot to create a new item in the summary list.</td>
</tr>
<tr>
<td><a href="#RawMetricsDialog.__finish">__finish</a></td>
<td>Private slot called when the action or the user pressed the button.</td>
</tr>
<tr>
<td><a href="#RawMetricsDialog.__getValues">__getValues</a></td>
<td>Private method to extract the code metric values.</td>
</tr>
<tr>
<td><a href="#RawMetricsDialog.__processError">__processError</a></td>
<td>Private slot to process an error indication from the service.</td>
</tr>
<tr>
<td><a href="#RawMetricsDialog.__processResult">__processResult</a></td>
<td>Private slot called after perfoming a code metrics calculation on one file.</td>
</tr>
<tr>
<td><a href="#RawMetricsDialog.__resizeResultColumns">__resizeResultColumns</a></td>
<td>Private method to resize the list columns.</td>
</tr>
<tr>
<td><a href="#RawMetricsDialog.clear">clear</a></td>
<td>Public method to clear all results.</td>
</tr>
<tr>
<td><a href="#RawMetricsDialog.closeEvent">closeEvent</a></td>
<td>Protected method to handle a close event.</td>
</tr>
<tr>
<td><a href="#RawMetricsDialog.on_buttonBox_clicked">on_buttonBox_clicked</a></td>
<td>Private slot called by a button of the button box clicked.</td>
</tr>
<tr>
<td><a href="#RawMetricsDialog.on_resultList_itemActivated">on_resultList_itemActivated</a></td>
<td>Private slot to handle the activation of a result item.</td>
</tr>
<tr>
<td><a href="#RawMetricsDialog.on_startButton_clicked">on_startButton_clicked</a></td>
<td>Private slot to start a code metrics run.</td>
</tr>
<tr>
<td><a href="#RawMetricsDialog.prepare">prepare</a></td>
<td>Public method to prepare the dialog with a list of filenames.</td>
</tr>
<tr>
<td><a href="#RawMetricsDialog.rawMetrics">rawMetrics</a></td>
<td>Public method to start a code metrics calculation for one Python file.</td>
</tr>
<tr>
<td><a href="#RawMetricsDialog.rawMetricsBatch">rawMetricsBatch</a></td>
<td>Public method to start a code metrics calculation batch job.</td>
</tr>
<tr>
<td><a href="#RawMetricsDialog.start">start</a></td>
<td>Public slot to start the code metrics determination.</td>
</tr>
</table>
<h3>Static Methods</h3>

<table>
<tr><td>None</td></tr>
</table>

<a NAME="RawMetricsDialog.__init__" ID="RawMetricsDialog.__init__"></a>
<h4>RawMetricsDialog (Constructor)</h4>
<b>RawMetricsDialog</b>(<i>radonService, parent=None</i>)

<p>
        Constructor
</p>
<dl>

<dt><i>radonService</i> (RadonMetricsPlugin)</dt>
<dd>
reference to the service
</dd>
<dt><i>parent</i> (QWidget)</dt>
<dd>
reference to the parent widget
</dd>
</dl>
<a NAME="RawMetricsDialog.__batchFinished" ID="RawMetricsDialog.__batchFinished"></a>
<h4>RawMetricsDialog.__batchFinished</h4>
<b>__batchFinished</b>(<i>type_</i>)

<p>
        Private slot handling the completion of a batch job.
</p>
<dl>

<dt><i>type_</i> (str, one of ["raw", "mi", "cc"])</dt>
<dd>
type of the calculated metrics
</dd>
</dl>
<a NAME="RawMetricsDialog.__cancel" ID="RawMetricsDialog.__cancel"></a>
<h4>RawMetricsDialog.__cancel</h4>
<b>__cancel</b>(<i></i>)

<p>
        Private method to cancel the current check run.
</p>
<a NAME="RawMetricsDialog.__createErrorItem" ID="RawMetricsDialog.__createErrorItem"></a>
<h4>RawMetricsDialog.__createErrorItem</h4>
<b>__createErrorItem</b>(<i>filename, message</i>)

<p>
        Private slot to create a new error item in the result list.
</p>
<dl>

<dt><i>filename</i> (str)</dt>
<dd>
name of the file
</dd>
<dt><i>message</i> (str)</dt>
<dd>
error message
</dd>
</dl>
<a NAME="RawMetricsDialog.__createResultItem" ID="RawMetricsDialog.__createResultItem"></a>
<h4>RawMetricsDialog.__createResultItem</h4>
<b>__createResultItem</b>(<i>filename, values</i>)

<p>
        Private slot to create a new item in the result list.
</p>
<dl>

<dt><i>filename</i> (str)</dt>
<dd>
name of the file
</dd>
<dt><i>values</i> (dict)</dt>
<dd>
values to be displayed
</dd>
</dl>
<a NAME="RawMetricsDialog.__createSummary" ID="RawMetricsDialog.__createSummary"></a>
<h4>RawMetricsDialog.__createSummary</h4>
<b>__createSummary</b>(<i></i>)

<p>
        Private method to create the code metrics summary.
</p>
<a NAME="RawMetricsDialog.__createSummaryItem" ID="RawMetricsDialog.__createSummaryItem"></a>
<h4>RawMetricsDialog.__createSummaryItem</h4>
<b>__createSummaryItem</b>(<i>col0, col1</i>)

<p>
        Private slot to create a new item in the summary list.
</p>
<dl>

<dt><i>col0</i> (str)</dt>
<dd>
string for column 0
</dd>
<dt><i>col1</i> (str)</dt>
<dd>
string for column 1
</dd>
</dl>
<a NAME="RawMetricsDialog.__finish" ID="RawMetricsDialog.__finish"></a>
<h4>RawMetricsDialog.__finish</h4>
<b>__finish</b>(<i></i>)

<p>
        Private slot called when the action or the user pressed the button.
</p>
<a NAME="RawMetricsDialog.__getValues" ID="RawMetricsDialog.__getValues"></a>
<h4>RawMetricsDialog.__getValues</h4>
<b>__getValues</b>(<i>result</i>)

<p>
        Private method to extract the code metric values.
</p>
<dl>

<dt><i>result</i> (dict)</dt>
<dd>
result dict
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
list of values suitable for display
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
list of str
</dd>
</dl>
<a NAME="RawMetricsDialog.__processError" ID="RawMetricsDialog.__processError"></a>
<h4>RawMetricsDialog.__processError</h4>
<b>__processError</b>(<i>type_, fn, msg</i>)

<p>
        Private slot to process an error indication from the service.
</p>
<dl>

<dt><i>type_</i> (str, one of ["raw", "mi", "cc"])</dt>
<dd>
type of the calculated metrics
</dd>
<dt><i>fn</i> (str)</dt>
<dd>
filename of the file
</dd>
<dt><i>msg</i> (str)</dt>
<dd>
error message
</dd>
</dl>
<a NAME="RawMetricsDialog.__processResult" ID="RawMetricsDialog.__processResult"></a>
<h4>RawMetricsDialog.__processResult</h4>
<b>__processResult</b>(<i>fn, result</i>)

<p>
        Private slot called after perfoming a code metrics calculation on one
        file.
</p>
<dl>

<dt><i>fn</i> (str)</dt>
<dd>
filename of the file
</dd>
<dt><i>result</i> (dict)</dt>
<dd>
result dict
</dd>
</dl>
<a NAME="RawMetricsDialog.__resizeResultColumns" ID="RawMetricsDialog.__resizeResultColumns"></a>
<h4>RawMetricsDialog.__resizeResultColumns</h4>
<b>__resizeResultColumns</b>(<i></i>)

<p>
        Private method to resize the list columns.
</p>
<a NAME="RawMetricsDialog.clear" ID="RawMetricsDialog.clear"></a>
<h4>RawMetricsDialog.clear</h4>
<b>clear</b>(<i></i>)

<p>
        Public method to clear all results.
</p>
<a NAME="RawMetricsDialog.closeEvent" ID="RawMetricsDialog.closeEvent"></a>
<h4>RawMetricsDialog.closeEvent</h4>
<b>closeEvent</b>(<i>evt</i>)

<p>
        Protected method to handle a close event.
</p>
<dl>

<dt><i>evt</i> (QCloseEvent)</dt>
<dd>
reference to the close event
</dd>
</dl>
<a NAME="RawMetricsDialog.on_buttonBox_clicked" ID="RawMetricsDialog.on_buttonBox_clicked"></a>
<h4>RawMetricsDialog.on_buttonBox_clicked</h4>
<b>on_buttonBox_clicked</b>(<i>button</i>)

<p>
        Private slot called by a button of the button box clicked.
</p>
<dl>

<dt><i>button</i> (QAbstractButton)</dt>
<dd>
button that was clicked
</dd>
</dl>
<a NAME="RawMetricsDialog.on_resultList_itemActivated" ID="RawMetricsDialog.on_resultList_itemActivated"></a>
<h4>RawMetricsDialog.on_resultList_itemActivated</h4>
<b>on_resultList_itemActivated</b>(<i>item, column</i>)

<p>
        Private slot to handle the activation of a result item.
</p>
<dl>

<dt><i>item</i> (QTreeWidgetItem)</dt>
<dd>
reference to the activated item
</dd>
<dt><i>column</i> (int)</dt>
<dd>
activated column
</dd>
</dl>
<a NAME="RawMetricsDialog.on_startButton_clicked" ID="RawMetricsDialog.on_startButton_clicked"></a>
<h4>RawMetricsDialog.on_startButton_clicked</h4>
<b>on_startButton_clicked</b>(<i></i>)

<p>
        Private slot to start a code metrics run.
</p>
<a NAME="RawMetricsDialog.prepare" ID="RawMetricsDialog.prepare"></a>
<h4>RawMetricsDialog.prepare</h4>
<b>prepare</b>(<i>fileList, project</i>)

<p>
        Public method to prepare the dialog with a list of filenames.
</p>
<dl>

<dt><i>fileList</i> (list of str)</dt>
<dd>
list of filenames
</dd>
<dt><i>project</i> (Project)</dt>
<dd>
reference to the project object
</dd>
</dl>
<a NAME="RawMetricsDialog.rawMetrics" ID="RawMetricsDialog.rawMetrics"></a>
<h4>RawMetricsDialog.rawMetrics</h4>
<b>rawMetrics</b>(<i></i>)

<p>
        Public method to start a code metrics calculation for one Python file.
</p>
<p>
        The results are reported to the __processResult slot.
</p>
<a NAME="RawMetricsDialog.rawMetricsBatch" ID="RawMetricsDialog.rawMetricsBatch"></a>
<h4>RawMetricsDialog.rawMetricsBatch</h4>
<b>rawMetricsBatch</b>(<i></i>)

<p>
        Public method to start a code metrics calculation batch job.
</p>
<p>
        The results are reported to the __processResult slot.
</p>
<a NAME="RawMetricsDialog.start" ID="RawMetricsDialog.start"></a>
<h4>RawMetricsDialog.start</h4>
<b>start</b>(<i>fn</i>)

<p>
        Public slot to start the code metrics determination.
</p>
<dl>

<dt><i>fn</i> (str or list of str)</dt>
<dd>
file or list of files or directory to show
            the code metrics for
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
</body></html>

eric ide

mercurial