Tue, 10 Dec 2024 15:48:54 +0100
Updated copyright for 2025.
<!DOCTYPE html> <html><head> <title>Plugin_Metrics_Radon.RadonMetrics.MaintainabilityIndexDialog</title> <meta charset="UTF-8"> <link rel="stylesheet" href="styles.css"> </head> <body> <a NAME="top" ID="top"></a> <h1>Plugin_Metrics_Radon.RadonMetrics.MaintainabilityIndexDialog</h1> <p> Module implementing a dialog to show maintainability indexes. </p> <h3>Global Attributes</h3> <table> <tr><td>None</td></tr> </table> <h3>Classes</h3> <table> <tr> <td><a href="#MaintainabilityIndexDialog">MaintainabilityIndexDialog</a></td> <td>Class implementing a dialog to show maintainability indexes.</td> </tr> </table> <h3>Functions</h3> <table> <tr><td>None</td></tr> </table> <hr /> <hr /> <a NAME="MaintainabilityIndexDialog" ID="MaintainabilityIndexDialog"></a> <h2>MaintainabilityIndexDialog</h2> <p> Class implementing a dialog to show maintainability indexes. </p> <h3>Derived from</h3> QDialog, Ui_MaintainabilityIndexDialog <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="#MaintainabilityIndexDialog.__init__">MaintainabilityIndexDialog</a></td> <td>Constructor</td> </tr> <tr> <td><a href="#MaintainabilityIndexDialog.__batchFinished">__batchFinished</a></td> <td>Private slot handling the completion of a batch job.</td> </tr> <tr> <td><a href="#MaintainabilityIndexDialog.__cancel">__cancel</a></td> <td>Private method to cancel the current check run.</td> </tr> <tr> <td><a href="#MaintainabilityIndexDialog.__createErrorItem">__createErrorItem</a></td> <td>Private slot to create a new error item in the result list.</td> </tr> <tr> <td><a href="#MaintainabilityIndexDialog.__createResultItem">__createResultItem</a></td> <td>Private slot to create a new item in the result list.</td> </tr> <tr> <td><a href="#MaintainabilityIndexDialog.__finish">__finish</a></td> <td>Private slot called when the action or the user pressed the button.</td> </tr> <tr> <td><a href="#MaintainabilityIndexDialog.__processError">__processError</a></td> <td>Private slot to process an error indication from the service.</td> </tr> <tr> <td><a href="#MaintainabilityIndexDialog.__processResult">__processResult</a></td> <td>Private slot called after perfoming a maintainability index calculation on one file.</td> </tr> <tr> <td><a href="#MaintainabilityIndexDialog.__resizeResultColumns">__resizeResultColumns</a></td> <td>Private method to resize the list columns.</td> </tr> <tr> <td><a href="#MaintainabilityIndexDialog.clear">clear</a></td> <td>Public method to clear all results.</td> </tr> <tr> <td><a href="#MaintainabilityIndexDialog.closeEvent">closeEvent</a></td> <td>Protected method to handle a close event.</td> </tr> <tr> <td><a href="#MaintainabilityIndexDialog.maintainabilityIndex">maintainabilityIndex</a></td> <td>Public method to start a maintainability index calculation for one Python file.</td> </tr> <tr> <td><a href="#MaintainabilityIndexDialog.maintainabilityIndexBatch">maintainabilityIndexBatch</a></td> <td>Public method to start a maintainability index calculation batch job.</td> </tr> <tr> <td><a href="#MaintainabilityIndexDialog.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="#MaintainabilityIndexDialog.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="#MaintainabilityIndexDialog.on_startButton_clicked">on_startButton_clicked</a></td> <td>Private slot to start a maintainability index run.</td> </tr> <tr> <td><a href="#MaintainabilityIndexDialog.prepare">prepare</a></td> <td>Public method to prepare the dialog with a list of filenames.</td> </tr> <tr> <td><a href="#MaintainabilityIndexDialog.start">start</a></td> <td>Public slot to start the maintainability index determination.</td> </tr> </table> <h3>Static Methods</h3> <table> <tr><td>None</td></tr> </table> <a NAME="MaintainabilityIndexDialog.__init__" ID="MaintainabilityIndexDialog.__init__"></a> <h4>MaintainabilityIndexDialog (Constructor)</h4> <b>MaintainabilityIndexDialog</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="MaintainabilityIndexDialog.__batchFinished" ID="MaintainabilityIndexDialog.__batchFinished"></a> <h4>MaintainabilityIndexDialog.__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="MaintainabilityIndexDialog.__cancel" ID="MaintainabilityIndexDialog.__cancel"></a> <h4>MaintainabilityIndexDialog.__cancel</h4> <b>__cancel</b>(<i></i>) <p> Private method to cancel the current check run. </p> <a NAME="MaintainabilityIndexDialog.__createErrorItem" ID="MaintainabilityIndexDialog.__createErrorItem"></a> <h4>MaintainabilityIndexDialog.__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="MaintainabilityIndexDialog.__createResultItem" ID="MaintainabilityIndexDialog.__createResultItem"></a> <h4>MaintainabilityIndexDialog.__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="MaintainabilityIndexDialog.__finish" ID="MaintainabilityIndexDialog.__finish"></a> <h4>MaintainabilityIndexDialog.__finish</h4> <b>__finish</b>(<i></i>) <p> Private slot called when the action or the user pressed the button. </p> <a NAME="MaintainabilityIndexDialog.__processError" ID="MaintainabilityIndexDialog.__processError"></a> <h4>MaintainabilityIndexDialog.__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="MaintainabilityIndexDialog.__processResult" ID="MaintainabilityIndexDialog.__processResult"></a> <h4>MaintainabilityIndexDialog.__processResult</h4> <b>__processResult</b>(<i>fn, result</i>) <p> Private slot called after perfoming a maintainability index 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="MaintainabilityIndexDialog.__resizeResultColumns" ID="MaintainabilityIndexDialog.__resizeResultColumns"></a> <h4>MaintainabilityIndexDialog.__resizeResultColumns</h4> <b>__resizeResultColumns</b>(<i></i>) <p> Private method to resize the list columns. </p> <a NAME="MaintainabilityIndexDialog.clear" ID="MaintainabilityIndexDialog.clear"></a> <h4>MaintainabilityIndexDialog.clear</h4> <b>clear</b>(<i></i>) <p> Public method to clear all results. </p> <a NAME="MaintainabilityIndexDialog.closeEvent" ID="MaintainabilityIndexDialog.closeEvent"></a> <h4>MaintainabilityIndexDialog.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="MaintainabilityIndexDialog.maintainabilityIndex" ID="MaintainabilityIndexDialog.maintainabilityIndex"></a> <h4>MaintainabilityIndexDialog.maintainabilityIndex</h4> <b>maintainabilityIndex</b>(<i></i>) <p> Public method to start a maintainability index calculation for one Python file. </p> <p> The results are reported to the __processResult slot. </p> <a NAME="MaintainabilityIndexDialog.maintainabilityIndexBatch" ID="MaintainabilityIndexDialog.maintainabilityIndexBatch"></a> <h4>MaintainabilityIndexDialog.maintainabilityIndexBatch</h4> <b>maintainabilityIndexBatch</b>(<i></i>) <p> Public method to start a maintainability index calculation batch job. </p> <p> The results are reported to the __processResult slot. </p> <a NAME="MaintainabilityIndexDialog.on_buttonBox_clicked" ID="MaintainabilityIndexDialog.on_buttonBox_clicked"></a> <h4>MaintainabilityIndexDialog.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="MaintainabilityIndexDialog.on_resultList_itemActivated" ID="MaintainabilityIndexDialog.on_resultList_itemActivated"></a> <h4>MaintainabilityIndexDialog.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="MaintainabilityIndexDialog.on_startButton_clicked" ID="MaintainabilityIndexDialog.on_startButton_clicked"></a> <h4>MaintainabilityIndexDialog.on_startButton_clicked</h4> <b>on_startButton_clicked</b>(<i></i>) <p> Private slot to start a maintainability index run. </p> <a NAME="MaintainabilityIndexDialog.prepare" ID="MaintainabilityIndexDialog.prepare"></a> <h4>MaintainabilityIndexDialog.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="MaintainabilityIndexDialog.start" ID="MaintainabilityIndexDialog.start"></a> <h4>MaintainabilityIndexDialog.start</h4> <b>start</b>(<i>fn</i>) <p> Public slot to start the maintainability index determination. </p> <dl> <dt><i>fn</i> (str or list of str)</dt> <dd> file or list of files or directory to show the maintainability index for </dd> </dl> <div align="right"><a href="#top">Up</a></div> <hr /> </body></html>