madrisan/dynamic-systems-and-chaos

View on GitHub

Showing 19 of 22 total issues

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

self.ensure(
r[0] >= self.map_rmin and r[0] < r[1] and r[1] <= self.map_rmax,
(
"The parameters [r0, r1] must be between %g and %g, "
"and in ascending order."
Severity: Major
Found in dynamic-systems-and-chaos/lelib.py and 1 other location - About 3 hrs to fix
dynamic-systems-and-chaos/lelib.py on lines 298..305

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

self.ensure(
y[0] >= self.map_ymin and y[0] < y[1] and y[1] <= self.map_ymax,
(
"The parameters [y0, y1] must be between %g and %g, "
"and in ascending order."
Severity: Major
Found in dynamic-systems-and-chaos/lelib.py and 1 other location - About 3 hrs to fix
dynamic-systems-and-chaos/lelib.py on lines 288..295

File lelib.py has 258 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/python3
 
# Logistic Equation Library
# Copyright (C) 2016-2018 Davide Madrisan <davide.madrisan@gmail.com>
# SPDX-License-Identifier: Apache-2.0
Severity: Minor
Found in dynamic-systems-and-chaos/lelib.py - About 2 hrs to fix

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

    for t in self.x[1:]:
    self.y1[t] = self.map(self.r, self.y1[t - 1])
    Severity: Major
    Found in dynamic-systems-and-chaos/lelib.py and 1 other location - About 2 hrs to fix
    dynamic-systems-and-chaos/lelib.py on lines 238..239

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

    for t in self.x[1:]:
    self.y2[t] = self.map(self.r, self.y2[t - 1])
    Severity: Major
    Found in dynamic-systems-and-chaos/lelib.py and 1 other location - About 2 hrs to fix
    dynamic-systems-and-chaos/lelib.py on lines 118..119

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

    m.ensure(x.sum() == n * (n + 1) / 2, "the sum of the elements of x is not correct")
    Severity: Major
    Found in dynamic-systems-and-chaos/lelib_test.py and 1 other location - About 1 hr to fix
    dynamic-systems-and-chaos/lelib_test.py on lines 56..56

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

    m.ensure(len(x) == n + 1, "x should be a vector of size %d" % (n + 1))
    Severity: Major
    Found in dynamic-systems-and-chaos/lelib_test.py and 4 other locations - About 1 hr to fix
    dynamic-systems-and-chaos/lelib_test.py on lines 53..53
    dynamic-systems-and-chaos/lelib_test.py on lines 58..58
    dynamic-systems-and-chaos/lelib_test.py on lines 79..79
    dynamic-systems-and-chaos/lelib_test.py on lines 83..84

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

    m.ensure(len(x) == n + 1, "x should be a vector of size %d" % (n + 1))
    Severity: Major
    Found in dynamic-systems-and-chaos/lelib_test.py and 4 other locations - About 1 hr to fix
    dynamic-systems-and-chaos/lelib_test.py on lines 58..58
    dynamic-systems-and-chaos/lelib_test.py on lines 74..74
    dynamic-systems-and-chaos/lelib_test.py on lines 79..79
    dynamic-systems-and-chaos/lelib_test.py on lines 83..84

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

    m.ensure(
    len(ydiff) == n + 1, "the vector y2-y1 should have a size equal to %d" % (n + 1)
    Severity: Major
    Found in dynamic-systems-and-chaos/lelib_test.py and 4 other locations - About 1 hr to fix
    dynamic-systems-and-chaos/lelib_test.py on lines 53..53
    dynamic-systems-and-chaos/lelib_test.py on lines 58..58
    dynamic-systems-and-chaos/lelib_test.py on lines 74..74
    dynamic-systems-and-chaos/lelib_test.py on lines 79..79

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

    m.ensure(x.sum() == n * (n + 1) / 2, "the sum of the elements of x is not correct")
    Severity: Major
    Found in dynamic-systems-and-chaos/lelib_test.py and 1 other location - About 1 hr to fix
    dynamic-systems-and-chaos/lelib_test.py on lines 77..77

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

    m.ensure(len(y1) == n + 1, "y1 should be a vector of size %d" % (n + 1))
    Severity: Major
    Found in dynamic-systems-and-chaos/lelib_test.py and 4 other locations - About 1 hr to fix
    dynamic-systems-and-chaos/lelib_test.py on lines 53..53
    dynamic-systems-and-chaos/lelib_test.py on lines 58..58
    dynamic-systems-and-chaos/lelib_test.py on lines 74..74
    dynamic-systems-and-chaos/lelib_test.py on lines 83..84

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

    m.ensure(len(y1) == n + 1, "y1 should be a vector of size %d" % (n + 1))
    Severity: Major
    Found in dynamic-systems-and-chaos/lelib_test.py and 4 other locations - About 1 hr to fix
    dynamic-systems-and-chaos/lelib_test.py on lines 53..53
    dynamic-systems-and-chaos/lelib_test.py on lines 74..74
    dynamic-systems-and-chaos/lelib_test.py on lines 79..79
    dynamic-systems-and-chaos/lelib_test.py on lines 83..84

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

    self.ensure(
    (r >= self.map_rmin and r <= self.map_rmax),
    "The growth parameter r must be between %g and %g",
    self.map_rmin,
    self.map_rmax,
    Severity: Major
    Found in dynamic-systems-and-chaos/lelib.py and 2 other locations - About 55 mins to fix
    dynamic-systems-and-chaos/lelib.py on lines 78..82
    dynamic-systems-and-chaos/lelib.py on lines 216..220

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

    self.ensure(
    x0 >= self.map_ymin and x0 <= self.map_ymax,
    "The initial condition x0 should be in [%g, %g].",
    self.map_ymin,
    self.map_ymax,
    Severity: Major
    Found in dynamic-systems-and-chaos/lelib.py and 2 other locations - About 55 mins to fix
    dynamic-systems-and-chaos/lelib.py on lines 53..57
    dynamic-systems-and-chaos/lelib.py on lines 216..220

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

    self.ensure(
    x1 >= self.map_ymin and x1 <= self.map_ymax,
    "The initial condition x1 should be in [%g, %g].",
    self.map_ymin,
    self.map_ymax,
    Severity: Major
    Found in dynamic-systems-and-chaos/lelib.py and 2 other locations - About 55 mins to fix
    dynamic-systems-and-chaos/lelib.py on lines 53..57
    dynamic-systems-and-chaos/lelib.py on lines 78..82

    Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def __init__(self, r, n, x0, x1, s=0, mapname="logistic"):
    Severity: Minor
    Found in dynamic-systems-and-chaos/lelib.py - About 45 mins to fix

      Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def __init__(self, r, n, x0, s=0, mapname="logistic"):
      Severity: Minor
      Found in dynamic-systems-and-chaos/lelib.py - About 35 mins to fix

        Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def __init__(self, r, n=1000, x0=0.5, s=2000, mapname="logistic"):
        Severity: Minor
        Found in dynamic-systems-and-chaos/lelib.py - About 35 mins to fix

          Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def __init__(self, r, y, n=100, s=200, mapname="logistic"):
          Severity: Minor
          Found in dynamic-systems-and-chaos/lelib.py - About 35 mins to fix
            Severity
            Category
            Status
            Source
            Language