# eric7.DataViews.CodeMetricsDialog

Module implementing a code metrics dialog.

### Global Attributes

None

### Classes

CodeMetricsDialog | Class implementing a dialog to display the code metrics.

### Functions

None

## CodeMetricsDialog

Class implementing a dialog to display the code metrics.

### Derived from

QDialog, Ui_CodeMetricsDialog

### Class Attributes

None

### Class Methods

None

### Methods

CodeMetricsDialog | Constructor
__createResultItem | Private slot to create a new item in the result list.
__createSummaryItem | Private slot to create a new item in the summary list.
__finish | Private slot called when the action finished or the user pressed the button.
__getValues | Private method to extract the code metric values.
__resizeResultColumns | Private method to resize the list columns.
__resizeSummaryColumns | Private method to resize the list columns.
__resultCollapse | Private slot to collapse all entries of the resultlist.
__resultExpand | Private slot to expand all entries of the resultlist.
__showContextMenu | Private slot to show the context menu of the listview.
closeEvent | Protected method to handle the close event.
on_buttonBox_clicked | Private slot called by a button of the button box clicked.
on_startButton_clicked | Private slot to start a code metrics run.
prepare | Public method to prepare the dialog with a list of filenames.
start | Public slot to start the code metrics determination.

### Static Methods

None

#### CodeMetricsDialog (Constructor)

CodeMetricsDialog(parent=None)

Constructor

parent (QWidget)
  parent widget

#### CodeMetricsDialog.__createResultItem

__createResultItem(parent, values)

Private slot to create a new item in the result list.

parent (QTreeWidget or QTreeWidgetItem)
  parent of the new item
values (list of int)
  values to be displayed

Return:
  the generated item

Return Type:
  QTreeWidgetItem

#### CodeMetricsDialog.__createSummaryItem

__createSummaryItem(col0, col1)

Private slot to create a new item in the summary list.

col0 (str)
  string for column 0
col1 (str)
  string for column 1

#### CodeMetricsDialog.__finish

__finish()

Private slot called when the action finished or the user pressed the button.

#### CodeMetricsDialog.__getValues

__getValues(loc, stats, identifier)

Private method to extract the code metric values.

loc (QLocale)
  reference to the locale object
stats (SourceStat)
  reference to the code metric statistics object
identifier (str)
  identifier to get values for

Return:
  list of values suitable for display

Return Type:
  list of str

#### CodeMetricsDialog.__resizeResultColumns

__resizeResultColumns()

Private method to resize the list columns.

#### CodeMetricsDialog.__resizeSummaryColumns

__resizeSummaryColumns()

Private method to resize the list columns.

#### CodeMetricsDialog.__resultCollapse

__resultCollapse()

Private slot to collapse all entries of the resultlist.

#### CodeMetricsDialog.__resultExpand

__resultExpand()

Private slot to expand all entries of the resultlist.

#### CodeMetricsDialog.__showContextMenu

__showContextMenu(coord)

Private slot to show the context menu of the listview.

coord (QPoint)
  the position of the mouse pointer

#### CodeMetricsDialog.closeEvent

closeEvent(evt)

Protected method to handle the close event.

evt (QCloseEvent)
  reference to the close event

#### CodeMetricsDialog.on_buttonBox_clicked

on_buttonBox_clicked(button)

Private slot called by a button of the button box clicked.

button (QAbstractButton)
  button that was clicked

#### CodeMetricsDialog.on_startButton_clicked

on_startButton_clicked()

Private slot to start a code metrics run.

#### CodeMetricsDialog.prepare

prepare(fileList)

Public method to prepare the dialog with a list of filenames.

fileList (list of str)
  list of filenames

#### CodeMetricsDialog.start

start(fn)

Public slot to start the code metrics determination.

fn (str or list of str)
  file or list of files or directory to show the code metrics for

Up