tomography/xdesign

View on GitHub

Showing 127 of 127 total issues

Avoid too many return statements within this function.
Open

                            return True
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 False
      Severity: Major
      Found in src/xdesign/geometry/area.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                                            return False
        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 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

                            Line too long (80 > 79 characters)
                            Open

                                    pairs = [(23, 12), (12, 19), (29, 11), (22, 5), (1, 3), (21, 9), (8, 2),
                            Severity: Minor
                            Found in src/xdesign/phantom/custom.py by pep8

                            Limit all lines to a maximum of 79 characters.

                            There are still many devices around that are limited to 80 character
                            lines; plus, limiting windows to 80 characters makes it possible to
                            have several windows side-by-side.  The default wrapping on such
                            devices looks ugly.  Therefore, please limit all lines to a maximum
                            of 79 characters. For flowing long blocks of text (docstrings or
                            comments), limiting the length to 72 characters is recommended.
                            
                            Reports error E501.
                            Severity
                            Category
                            Status
                            Source
                            Language