Showing 68 of 135 total issues
Function setupUi
has 663 lines of code (exceeds 25 allowed). Consider refactoring. Open
def setupUi(self, MainWindow):
if not MainWindow.objectName():
MainWindow.setObjectName(u"MainWindow")
MainWindow.resize(1068, 848)
self.actionNew = QAction(MainWindow)
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
File ui_diatom.py
has 771 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'diatomWVoSsf.ui'
##
Diatom
has 61 functions (exceeds 20 allowed). Consider refactoring. Open
class Diatom(QtWidgets.QMainWindow, Ui_MainWindow):
def __init__(self):
super().__init__()
Function retranslateUi
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MainWindow", None))
self.actionNew.setText(QCoreApplication.translate("MainWindow", u"New", None))
self.groupBox.setTitle(QCoreApplication.translate("MainWindow", u"Levels, Fit and Spectrum", None))
self.paramsFileLabel.setText(QCoreApplication.translate("MainWindow", u"Parameters file:", None))
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
Spectrum
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class Spectrum:
def __init__(self, H, dmfs=None, spec_type='absorption'):
"""Calculate the spectral quantities
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 set_data_parameters
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def set_data_parameters(self, fname):
"""Set the input data parameters
Args:
fname (str): The name of the file containing the values
- 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__
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, nstate, Js=None, Je=None, Jvalues=None, symmetry=(0,),
Function __init__
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, objs=None, pair_states=None, label='', model='pointwise',
rotc=0.0, multiplier=1, custom_func=None, shift_by=0.0):
diatomic, grid, states = objs[0], objs[1], objs[2]
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 solve
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def solve(self, ops, ypar=None, energy_range_index=None, energy_range_value=None):
"""A general function which solves the coupled system of Shcrodinger equations
Args:
energy_range_index (tuple, optional): Specifies a subset of
- 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 _compute_rot_factors
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def _compute_rot_factors(self, usymm, lsymm, uj, lj, uomega,
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, objs, pair_states, label, model='pointwise', rotc=0.0,
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 = []