File gui.py
has 909 lines of code (exceeds 250 allowed). Consider refactoring. Open
import sys
import numpy as np
from PyQt5 import QtCore, QtGui, QtWidgets
import pyqtgraph as pg
Diatom
has 61 functions (exceeds 20 allowed). Consider refactoring. Open
class Diatom(QtWidgets.QMainWindow, Ui_MainWindow):
def __init__(self):
super().__init__()
Function __init__
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self):
super().__init__()
Ui_MainWindow.__init__(self)
self.setupUi(self)
Function _generate_state_widgets
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _generate_state_widgets(self):
global state_count
state_count += 1
top_margin = 30
Function _on_preview_output_button_clicked
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def _on_preview_output_button_clicked(self):
if self.calc_eigenenr:
try:
cal_eignenr = np.genfromtxt(self.file_eigenenr, comments='#', autostrip=True)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _generate_operator_widgets
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _generate_operator_widgets(self):
global opr_count
opr_count += 1
top_margin = 30
Function _on_solve_button_clicked
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def _on_solve_button_clicked(self):
diatomic = Diatomic(
molecule=self.sel_isotopes,
refj=self.refj,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _init_state_dynamic_widget_lists
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _init_state_dynamic_widget_lists(self):
self.stateGridLayouts = []
self.stateLabels = []
self.stateJsLabels = []
Function _on_solve_button_clicked
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _on_solve_button_clicked(self):
diatomic = Diatomic(
molecule=self.sel_isotopes,
refj=self.refj,
Function _init_operator_dynamic_widget_lists
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _init_operator_dynamic_widget_lists(self):
self.operatorGridLayouts = []
self.operatorTypeLabels = []
self.operatorPairStateLabels = []
Function _on_show_radial_parameters_button_clicked
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _on_show_radial_parameters_button_clicked(self, index):
# self._toggle_table_widget()
params = []
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _remove_layout
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _remove_layout(self, layout):
print(layout)
for i in range(len(layout)):
print(i, layout[i])
temp_layout = layout[i]
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _on_preview_input_params_button_clicked
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _on_preview_input_params_button_clicked(self):
self._toggle_table_widget()
params = []
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _on_plot_rad_params_push_button_clicked
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _on_plot_rad_params_push_button_clicked(self, index):
params = []
found = False
with open(self.input_params_file, encoding='utf-8') as fstrm:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"