Drapegnik/bsu

View on GitHub

Showing 241 of 241 total issues

Similar blocks of code found in 3 locations. Consider refactoring.
Open

            jobs_free_reserves[i][j] = events_early_terms[j] - events_early_terms[i] - time_matrix[i][j]
Severity: Major
Found in decision-science/lab6/main.py and 2 other locations - About 2 hrs to fix
decision-science/lab6/main.py on lines 72..72
decision-science/lab6/main.py on lines 75..75

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 53.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

            jobs_guaranteed_reserves[i][j] = events_late_terms[j] - events_late_terms[i] - time_matrix[i][j]
Severity: Major
Found in decision-science/lab6/main.py and 2 other locations - About 2 hrs to fix
decision-science/lab6/main.py on lines 72..72
decision-science/lab6/main.py on lines 73..73

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 53.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            x = r*cos(2.0*pi*i/num + alpha) + self.get_location().x()
Severity: Major
Found in technology/lab1/src/RegularShape.py and 1 other location - About 2 hrs to fix
technology/lab1/src/RegularShape.py on lines 22..22

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 53.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

            jobs_summary_reserves[i][j] = events_late_terms[j] - events_early_terms[i] - time_matrix[i][j]
Severity: Major
Found in decision-science/lab6/main.py and 2 other locations - About 2 hrs to fix
decision-science/lab6/main.py on lines 73..73
decision-science/lab6/main.py on lines 75..75

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 53.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            y = r*sin(2.0*pi*i/num + alpha) + self.get_location().y()
Severity: Major
Found in technology/lab1/src/RegularShape.py and 1 other location - About 2 hrs to fix
technology/lab1/src/RegularShape.py on lines 21..21

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 53.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      const styles = StyleSheet.create({
        labelWrapper: {
          marginTop: 10,
          marginBottom: 10,
        },
      Severity: Major
      Found in cryptography/lab2/client/components/NumberInput.js and 1 other location - About 2 hrs to fix
      cryptography/lab2/client/components/LoginForm.js on lines 4..20

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 79.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      const styles = StyleSheet.create({
        labelWrapper: {
          marginTop: 10,
          marginBottom: 10,
        },
      Severity: Major
      Found in cryptography/lab2/client/components/LoginForm.js and 1 other location - About 2 hrs to fix
      cryptography/lab2/client/components/NumberInput.js on lines 4..20

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 79.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

          public static ArrayList<Student> generateFakeData() {
              ArrayList<Student> data = new ArrayList<>();
              data.add(new Student("Perry Hodges", 1));
              data.add(new Student("Patrick Richardson", 2));
              data.add(new Student("Doug Evans", 3));
      Severity: Major
      Found in programming/java/sem6/lab3/src/app/models/Student.java and 1 other location - About 2 hrs to fix
      programming/java/sem6/lab1/src/app/models/Student.java on lines 174..187

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 135.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      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

      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

      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

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

          public static ArrayList<Student> generateFakeData() {
              ArrayList<Student> data = new ArrayList<>();
              data.add(new Student("Perry Hodges", 1));
              data.add(new Student("Patrick Richardson", 2));
              data.add(new Student("Doug Evans", 3));
      Severity: Major
      Found in programming/java/sem6/lab1/src/app/models/Student.java and 1 other location - About 2 hrs to fix
      programming/java/sem6/lab3/src/app/models/Student.java on lines 148..161

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 135.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          public void initDB() {
              System.out.println("[dbDriver] Init database...");
              ArrayList<Student> data = Student.readFromFile(Options.STUDENTS_FILE_NAME);
              Random random = new Random();
      
      
      Severity: Major
      Found in programming/java/sem6/lab3/src/app/backend/dbDriver.java and 1 other location - About 2 hrs to fix
      programming/java/sem6/lab1/src/app/backend/sqlDriver.java on lines 288..304

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 133.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          private void initDB() {
              System.out.println("Init database...");
              ArrayList<Student> data = Student.readFromFile(Options.STUDENTS_FILE_NAME);
              Random random = new Random();
      
      
      Severity: Major
      Found in programming/java/sem6/lab1/src/app/backend/sqlDriver.java and 1 other location - About 2 hrs to fix
      programming/java/sem6/lab3/src/app/backend/dbDriver.java on lines 285..301

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 133.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      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

        Function dijkstra has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

        def dijkstra(graph, start):
            """
            find min distance for all nodes from s
            :param graph: adjacency list of Edge objects
            :param start: start node
        Severity: Minor
        Found in decision-science/lab3/algorithms.py - About 1 hr 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

        Similar blocks of code found in 5 locations. Consider refactoring.
        Open

        for line in inp:  # читаем А и b
            temp = [float(x) for x in line.split()]
            f.append(temp.pop())
            A.append(temp)
        Severity: Major
        Found in numerical-analysis/sem3/lab4/script.py and 4 other locations - About 1 hr to fix
        numerical-analysis/sem3/lab2/script.py on lines 12..15
        numerical-analysis/sem3/lab3/script.py on lines 11..14
        numerical-analysis/sem3/lab5/script.py on lines 12..15
        numerical-analysis/sem3/lab6/script.py on lines 13..16

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 49.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Severity
        Category
        Status
        Source
        Language