Wed, 26 May 2021 17:43:25 +0200
Ported the plug-in to PyQt6 for eric7.
<!DOCTYPE html> <html><head> <title>Plugin_Metrics_Radon.RadonMetrics.CyclomaticComplexityDialog</title> <meta charset="UTF-8"> <style> body { background: #EDECE6; margin: 0em 1em 10em 1em; color: black; } h1 { color: white; background: #85774A; } h2 { color: white; background: #85774A; } h3 { color: white; background: #9D936E; } h4 { color: white; background: #9D936E; } a { color: #BA6D36; } </style> </head> <body> <a NAME="top" ID="top"></a> <h1>Plugin_Metrics_Radon.RadonMetrics.CyclomaticComplexityDialog</h1> <p> Module implementing a dialog to show the cyclomatic complexity (McCabe complexity). </p> <h3>Global Attributes</h3> <table> <tr><td>None</td></tr> </table> <h3>Classes</h3> <table> <tr> <td><a href="#CyclomaticComplexityDialog">CyclomaticComplexityDialog</a></td> <td>Class implementing a dialog to show the cyclomatic complexity (McCabe complexity).</td> </tr> </table> <h3>Functions</h3> <table> <tr><td>None</td></tr> </table> <hr /> <hr /> <a NAME="CyclomaticComplexityDialog" ID="CyclomaticComplexityDialog"></a> <h2>CyclomaticComplexityDialog</h2> <p> Class implementing a dialog to show the cyclomatic complexity (McCabe complexity). </p> <h3>Derived from</h3> QDialog, Ui_CyclomaticComplexityDialog <h3>Class Attributes</h3> <table> <tr><td>FilePathRole</td></tr><tr><td>LineNumberRole</td></tr> </table> <h3>Class Methods</h3> <table> <tr><td>None</td></tr> </table> <h3>Methods</h3> <table> <tr> <td><a href="#CyclomaticComplexityDialog.__init__">CyclomaticComplexityDialog</a></td> <td>Constructor</td> </tr> <tr> <td><a href="#CyclomaticComplexityDialog.__batchFinished">__batchFinished</a></td> <td>Private slot handling the completion of a batch job.</td> </tr> <tr> <td><a href="#CyclomaticComplexityDialog.__createErrorItem">__createErrorItem</a></td> <td>Private slot to create a new error item in the result list.</td> </tr> <tr> <td><a href="#CyclomaticComplexityDialog.__createFileItem">__createFileItem</a></td> <td>Private method to create a new file item in the result list.</td> </tr> <tr> <td><a href="#CyclomaticComplexityDialog.__createResultItem">__createResultItem</a></td> <td>Private slot to create a new item in the result list.</td> </tr> <tr> <td><a href="#CyclomaticComplexityDialog.__finish">__finish</a></td> <td>Private slot called when the action or the user pressed the button.</td> </tr> <tr> <td><a href="#CyclomaticComplexityDialog.__processError">__processError</a></td> <td>Private slot to process an error indication from the service.</td> </tr> <tr> <td><a href="#CyclomaticComplexityDialog.__processResult">__processResult</a></td> <td>Private slot called after perfoming a cyclomatic complexity calculation on one file.</td> </tr> <tr> <td><a href="#CyclomaticComplexityDialog.__resizeResultColumns">__resizeResultColumns</a></td> <td>Private method to resize the list columns.</td> </tr> <tr> <td><a href="#CyclomaticComplexityDialog.__resultCollapse">__resultCollapse</a></td> <td>Private slot to collapse all entries of the resultlist.</td> </tr> <tr> <td><a href="#CyclomaticComplexityDialog.__resultExpand">__resultExpand</a></td> <td>Private slot to expand all entries of the resultlist.</td> </tr> <tr> <td><a href="#CyclomaticComplexityDialog.__showContextMenu">__showContextMenu</a></td> <td>Private slot to show the context menu of the resultlist.</td> </tr> <tr> <td><a href="#CyclomaticComplexityDialog.clear">clear</a></td> <td>Public method to clear all results.</td> </tr> <tr> <td><a href="#CyclomaticComplexityDialog.cyclomaticComplexity">cyclomaticComplexity</a></td> <td>Public method to start a cyclomatic complexity calculation for one Python file.</td> </tr> <tr> <td><a href="#CyclomaticComplexityDialog.cyclomaticComplexityBatch">cyclomaticComplexityBatch</a></td> <td>Public method to start a cyclomatic complexity calculation batch job.</td> </tr> <tr> <td><a href="#CyclomaticComplexityDialog.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="#CyclomaticComplexityDialog.on_rankComboBox_activated">on_rankComboBox_activated</a></td> <td>Private slot to handle the selection of a minimum rank.</td> </tr> <tr> <td><a href="#CyclomaticComplexityDialog.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="#CyclomaticComplexityDialog.on_startButton_clicked">on_startButton_clicked</a></td> <td>Private slot to start a cyclomatic complexity run.</td> </tr> <tr> <td><a href="#CyclomaticComplexityDialog.prepare">prepare</a></td> <td>Public method to prepare the dialog with a list of filenames.</td> </tr> <tr> <td><a href="#CyclomaticComplexityDialog.start">start</a></td> <td>Public slot to start the cyclomatic complexity determination.</td> </tr> </table> <h3>Static Methods</h3> <table> <tr><td>None</td></tr> </table> <a NAME="CyclomaticComplexityDialog.__init__" ID="CyclomaticComplexityDialog.__init__"></a> <h4>CyclomaticComplexityDialog (Constructor)</h4> <b>CyclomaticComplexityDialog</b>(<i>radonService, isSingle=False, parent=None</i>) <p> Constructor </p> <dl> <dt><i>radonService</i> (RadonMetricsPlugin)</dt> <dd> reference to the service </dd> <dt><i>isSingle</i> (bool)</dt> <dd> flag indicating a single file dialog </dd> <dt><i>parent</i> (QWidget)</dt> <dd> reference to the parent widget </dd> </dl> <a NAME="CyclomaticComplexityDialog.__batchFinished" ID="CyclomaticComplexityDialog.__batchFinished"></a> <h4>CyclomaticComplexityDialog.__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="CyclomaticComplexityDialog.__createErrorItem" ID="CyclomaticComplexityDialog.__createErrorItem"></a> <h4>CyclomaticComplexityDialog.__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="CyclomaticComplexityDialog.__createFileItem" ID="CyclomaticComplexityDialog.__createFileItem"></a> <h4>CyclomaticComplexityDialog.__createFileItem</h4> <b>__createFileItem</b>(<i>filename</i>) <p> Private method to create a new file item in the result list. </p> <dl> <dt><i>filename</i> (str)</dt> <dd> name of the file </dd> </dl> <dl> <dt>Return:</dt> <dd> reference to the created item </dd> </dl> <dl> <dt>Return Type:</dt> <dd> QTreeWidgetItem </dd> </dl> <a NAME="CyclomaticComplexityDialog.__createResultItem" ID="CyclomaticComplexityDialog.__createResultItem"></a> <h4>CyclomaticComplexityDialog.__createResultItem</h4> <b>__createResultItem</b>(<i>parentItem, values</i>) <p> Private slot to create a new item in the result list. </p> <dl> <dt><i>parentItem</i> (QTreeWidgetItem)</dt> <dd> reference to the parent item </dd> <dt><i>values</i> (dict)</dt> <dd> values to be displayed </dd> </dl> <a NAME="CyclomaticComplexityDialog.__finish" ID="CyclomaticComplexityDialog.__finish"></a> <h4>CyclomaticComplexityDialog.__finish</h4> <b>__finish</b>(<i></i>) <p> Private slot called when the action or the user pressed the button. </p> <a NAME="CyclomaticComplexityDialog.__processError" ID="CyclomaticComplexityDialog.__processError"></a> <h4>CyclomaticComplexityDialog.__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="CyclomaticComplexityDialog.__processResult" ID="CyclomaticComplexityDialog.__processResult"></a> <h4>CyclomaticComplexityDialog.__processResult</h4> <b>__processResult</b>(<i>fn, result</i>) <p> Private slot called after perfoming a cyclomatic complexity 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="CyclomaticComplexityDialog.__resizeResultColumns" ID="CyclomaticComplexityDialog.__resizeResultColumns"></a> <h4>CyclomaticComplexityDialog.__resizeResultColumns</h4> <b>__resizeResultColumns</b>(<i></i>) <p> Private method to resize the list columns. </p> <a NAME="CyclomaticComplexityDialog.__resultCollapse" ID="CyclomaticComplexityDialog.__resultCollapse"></a> <h4>CyclomaticComplexityDialog.__resultCollapse</h4> <b>__resultCollapse</b>(<i></i>) <p> Private slot to collapse all entries of the resultlist. </p> <a NAME="CyclomaticComplexityDialog.__resultExpand" ID="CyclomaticComplexityDialog.__resultExpand"></a> <h4>CyclomaticComplexityDialog.__resultExpand</h4> <b>__resultExpand</b>(<i></i>) <p> Private slot to expand all entries of the resultlist. </p> <a NAME="CyclomaticComplexityDialog.__showContextMenu" ID="CyclomaticComplexityDialog.__showContextMenu"></a> <h4>CyclomaticComplexityDialog.__showContextMenu</h4> <b>__showContextMenu</b>(<i>coord</i>) <p> Private slot to show the context menu of the resultlist. </p> <dl> <dt><i>coord</i></dt> <dd> the position of the mouse pointer (QPoint) </dd> </dl> <a NAME="CyclomaticComplexityDialog.clear" ID="CyclomaticComplexityDialog.clear"></a> <h4>CyclomaticComplexityDialog.clear</h4> <b>clear</b>(<i></i>) <p> Public method to clear all results. </p> <a NAME="CyclomaticComplexityDialog.cyclomaticComplexity" ID="CyclomaticComplexityDialog.cyclomaticComplexity"></a> <h4>CyclomaticComplexityDialog.cyclomaticComplexity</h4> <b>cyclomaticComplexity</b>(<i>codestring=''</i>) <p> Public method to start a cyclomatic complexity calculation for one Python file. </p> <p> The results are reported to the __processResult slot. </p> <dl> <dt><i>codestring</i> (str)</dt> <dd> optional sourcestring </dd> </dl> <a NAME="CyclomaticComplexityDialog.cyclomaticComplexityBatch" ID="CyclomaticComplexityDialog.cyclomaticComplexityBatch"></a> <h4>CyclomaticComplexityDialog.cyclomaticComplexityBatch</h4> <b>cyclomaticComplexityBatch</b>(<i></i>) <p> Public method to start a cyclomatic complexity calculation batch job. </p> <p> The results are reported to the __processResult slot. </p> <a NAME="CyclomaticComplexityDialog.on_buttonBox_clicked" ID="CyclomaticComplexityDialog.on_buttonBox_clicked"></a> <h4>CyclomaticComplexityDialog.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="CyclomaticComplexityDialog.on_rankComboBox_activated" ID="CyclomaticComplexityDialog.on_rankComboBox_activated"></a> <h4>CyclomaticComplexityDialog.on_rankComboBox_activated</h4> <b>on_rankComboBox_activated</b>(<i>rank</i>) <p> Private slot to handle the selection of a minimum rank. </p> <dl> <dt><i>rank</i> (str)</dt> <dd> selected minimum rank </dd> </dl> <a NAME="CyclomaticComplexityDialog.on_resultList_itemActivated" ID="CyclomaticComplexityDialog.on_resultList_itemActivated"></a> <h4>CyclomaticComplexityDialog.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="CyclomaticComplexityDialog.on_startButton_clicked" ID="CyclomaticComplexityDialog.on_startButton_clicked"></a> <h4>CyclomaticComplexityDialog.on_startButton_clicked</h4> <b>on_startButton_clicked</b>(<i></i>) <p> Private slot to start a cyclomatic complexity run. </p> <a NAME="CyclomaticComplexityDialog.prepare" ID="CyclomaticComplexityDialog.prepare"></a> <h4>CyclomaticComplexityDialog.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="CyclomaticComplexityDialog.start" ID="CyclomaticComplexityDialog.start"></a> <h4>CyclomaticComplexityDialog.start</h4> <b>start</b>(<i>fn, minRank="D"</i>) <p> Public slot to start the cyclomatic complexity determination. </p> <dl> <dt><i>fn</i> (str or list of str)</dt> <dd> file or list of files or directory to show the cyclomatic complexity for </dd> <dt><i>minRank</i> (str (one character out of A - F))</dt> <dd> minimum rank of entries to be shown </dd> </dl> <div align="right"><a href="#top">Up</a></div> <hr /> </body></html>