Drapegnik/bsu

View on GitHub

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):
Severity: Minor
Found in decision-science/lab5/Little.py - About 5 hrs to fix

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)]
Severity: Minor
Found in decision-science/lab5/Little.py - About 5 hrs to fix

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(
Severity: Minor
Found in architecture/lab3-poisson/task.py - About 4 hrs to fix

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)
Severity: Minor
Found in programming/java/sem3/lab7/src/Paint.java - About 4 hrs to fix

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:
Severity: Minor
Found in technology/lab1/ui/DrawArea.py - About 4 hrs to fix

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;
Severity: Minor
Found in programming/java/sem3/lab3/src/Main.java - About 3 hrs to fix

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 = "«(";

Severity: Minor
Found in programming/java/sem5/lab1/src/Main.java - About 3 hrs to fix

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()) {
Severity: Minor
Found in programming/java/sem3/lab2/src/Main.java - About 2 hrs to fix

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,
Severity: Minor
Found in statistical-modeling/lab2/utils.py - About 2 hrs to fix

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;
Severity: Minor
Found in programming/java/sem5/lab5/src/CalcJDialog.java - About 2 hrs to fix

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)])
Severity: Minor
Found in decision-science/lab6/main.py - About 2 hrs to fix

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());

Severity: Minor
Found in programming/java/sem5/lab2/src/Main.java - About 2 hrs to fix

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();

Severity: Minor
Found in programming/java/sem3/lab5/src/MyJFrame.java - About 2 hrs to fix

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);
Severity: Major
Found in programming/java/sem6/lab3/src/app/MainController.java - About 2 hrs to fix

    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)
    Severity: Major
    Found in programming/java/sem3/lab7/src/Paint.java - About 2 hrs to fix

      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());
      Severity: Minor
      Found in programming/java/sem3/lab9/src/MyJFrame.java - About 2 hrs to fix

      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
      Severity: Minor
      Found in architecture/lab3-poisson/task.py - About 2 hrs to fix

      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:
      Severity: Minor
      Found in decision-science/lab3/algorithms.py - About 2 hrs to fix

      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()) {
      Severity: Minor
      Found in programming/java/sem3/exam/src/MainFrame.java - About 2 hrs to fix

      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,
      Severity: Major
      Found in cryptography/lab2/client/App.js - About 2 hrs to fix
        Severity
        Category
        Status
        Source
        Language