Showing 108 of 241 total issues
Function best_edge
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def best_edge(size, w, row, col):
mosti = -INF
ri = 0
ci = 0
for i in xrange(size):
- 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 explore
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def explore(n, w, edges, cost, row, col, best, fwdptr, backptr):
global best_cost
colred = [0 for _ in xrange(n)]
rowred = [0 for _ in xrange(n)]
- 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 a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, full_region, region, left_top, step_x, step_y):
self.full_region, self.region, self.left_top, self.step_x, self.step_y = full_region, region, left_top, step_x, step_y
self.rows = region.bottom - region.top
self.cols = region.right - region.left
self.calc_region = Region(
- 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
Method actionPerformed
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == btnColor) {
Color tempColor = JColorChooser.showDialog(this, "Choose a color", color);
if (tempColor != null)
- 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 mousePressEvent
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def mousePressEvent(self, event):
border_color = self.parent.sidebar.border_color_btn.color()
bg_color = self.parent.sidebar.bg_color_btn.color()
if not self.drawling:
- 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
Method gaus
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public static void gaus() {
x = new double[n];
where = new int [n];
// for (int i = 0; i < n; i++)
// where[i]=-1;
- 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
Method normalizePunctuation
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
private String normalizePunctuation(String text) {
StringTokenizer st = new StringTokenizer(text, PUNCT_MARKS, true);
StringBuffer sb = new StringBuffer();
String openBrackets = "«(";
- 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
Method main
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public static void main(String[] args) {
String s = args[0];
StringTokenizer st = new StringTokenizer(s, "()+-*/", true);
while (st.hasMoreTokens()) {
- 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 run
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def run(
title,
generator,
distr,
args,
- 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
Method actionPerformed
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public void actionPerformed(ActionEvent e) {
if (e.getSource() == exec) {
try {
Object[] arguments = new Object[args.size()];
int id = 0;
- 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 count_params
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def count_params(filename):
time_matrix = edges_list_to_matrix(filename)
n = len(time_matrix)
events_early_terms = np.array([-float('inf') for _ in range(n)])
- 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
Method actionPerformed
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public void actionPerformed(ActionEvent e) {
if (e.getSource() == show) {
show(list, data);
TreeSet<Student> set = new TreeSet<>(new MyComparator());
- 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
Method actionPerformed
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public void actionPerformed(ActionEvent e) {
if (e.getSource() == show) {
String title = radio1.isSelected() ? radio1.getText() : radio2.getText();
String message = radio1.isSelected() ? a.toString() : b.toString();
- 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
Method doAction
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void doAction(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String action = request.getParameter("action");
if (action == null) {
request.setAttribute("status", "404");
request.getRequestDispatcher("/").forward(request, response);
Method actionPerformed
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == btnColor) {
Color tempColor = JColorChooser.showDialog(this, "Choose a color", color);
if (tempColor != null)
Method actionPerformed
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public void actionPerformed(ActionEvent e) {
if (e.getSource() == show) {
show(list, a);
TreeSet<Student> set1 = new TreeSet<>(new MyComparator());
TreeSet<Student> set2 = new TreeSet<>(new MyComparator());
- 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
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def set(self, i, j, val):
if j == -1:
self.neighbor_left_border[i] = val
elif j == self.cols:
self.neighbor_right_border[i] = val
- 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 floyd
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def floyd(d):
"""
find min distance for all nodes
:param d: matrix adjacency with distance
:return:
- 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
Method actionPerformed
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == add) {
ModalDialog dlg = (new ModalDialog(this, "add"));
if (dlg.isOk()) {
- 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 render
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
user,
password,
error,