tomography/xdesign

View on GitHub

Showing 54 of 127 total issues

Avoid too many return statements within this function.
Open

    return True
Severity: Major
Found in src/xdesign/codes.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return np.sum((x - self.center._x)**2, axis=1) > self.radius**2
    Severity: Major
    Found in src/xdesign/geometry/area.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return np.sum((x - self.center._x)**2, axis=1) < self.radius**2
      Severity: Major
      Found in src/xdesign/geometry/area.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                                return (-other).contains(-self)
        Severity: Major
        Found in src/xdesign/geometry/area.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return np.logical_not(border.contains_points(np.atleast_2d(x)))
          Severity: Major
          Found in src/xdesign/geometry/area.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                                    return np.all(self.contains(x))
            Severity: Major
            Found in src/xdesign/geometry/area.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                                      return (
              Severity: Major
              Found in src/xdesign/geometry/area.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                        return (-other).contains(-self)
                Severity: Major
                Found in src/xdesign/geometry/area.py - About 30 mins to fix

                  Function rotate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def rotate(self, theta, point=None, axis=None):
                          """Rotates the Polygon around an axis which passes through a point by
                          theta radians."""
                          for v in self.vertices:
                              v.rotate(theta, point, axis)
                  Severity: Minor
                  Found in src/xdesign/geometry/area.py - About 25 mins 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 plot_geometry has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def plot_geometry(geometry, axis=None, alpha=None, c=None, z=0.0, t=0.0001):
                      """Plot a :class:`.Entity` on the given axis.
                  
                      Parameters
                      ----------
                  Severity: Minor
                  Found in src/xdesign/plot.py - About 25 mins 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 ssim has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def ssim(
                      img1,
                      img2,
                      sigma=1.2,
                      L=1,
                  Severity: Minor
                  Found in src/xdesign/metrics/fullref.py - About 25 mins 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 _full_reference_input_check has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def _full_reference_input_check(img0, img1, sigma, nlevels, L):
                      """Checks full reference quality measures for valid inputs."""
                      if nlevels <= 0:
                          raise ValueError('nlevels must be >= 1.')
                      if sigma < 1.2:
                  Severity: Minor
                  Found in src/xdesign/metrics/fullref.py - About 25 mins 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 discrete_geometry has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def discrete_geometry(geometry, psize, ratio=9):
                      """Draw the geometry onto a patch the size of its bounding box.
                  
                      Parameters
                      ----------
                  Severity: Minor
                  Found in src/xdesign/plot.py - About 25 mins 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 msssim has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def msssim(
                      img0,
                      img1,
                      nlevels=5,
                      sigma=1.2,
                  Severity: Minor
                  Found in src/xdesign/metrics/fullref.py - About 25 mins 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

                  Severity
                  Category
                  Status
                  Source
                  Language