albarji/proxTV

View on GitHub

Showing 16 of 27 total issues

File __init__.py has 464 lines of code (exceeds 250 allowed). Consider refactoring.
Open

r"""**proxTV** is a toolbox implementing blazing fast implementations of Total Variation proximity operators.

The library provides efficient solvers for the following Total Variation proximity problems:

**Standard (l1) Total Variation on a 1-dimensional signal**
Severity: Minor
Found in prox_tv/__init__.py - About 7 hrs to fix

    Function tvp_2d has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def tvp_2d(x, w_col, w_row, p_col, p_row, n_threads=1, max_iters=0):
    Severity: Major
    Found in prox_tv/__init__.py - About 50 mins to fix

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

      def tvgen(x, ws, ds, ps, n_threads=1, max_iters=0):
      Severity: Minor
      Found in prox_tv/__init__.py - About 45 mins to fix

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

        def _chambollepock_tv2d(x, w, y, max_iters, info, **kwargs):
        Severity: Minor
        Found in prox_tv/__init__.py - About 45 mins to fix

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

          def _chambollepockacc_tv2d(x, w, y, max_iters, info, **kwargs):
          Severity: Minor
          Found in prox_tv/__init__.py - About 45 mins to fix

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

            def _dr_tv2d(x, w, y, max_iters, info, **kwargs):
            Severity: Minor
            Found in prox_tv/__init__.py - About 45 mins to fix

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

              def _pd_tv2d(x, w, y, max_iters, info, **kwargs):
              Severity: Minor
              Found in prox_tv/__init__.py - About 45 mins to fix

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

                def _kolmogorov_tv2d(x, w, y, max_iters, info, **kwargs):
                Severity: Minor
                Found in prox_tv/__init__.py - About 45 mins to fix

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

                  def _condat_tv2d(x, w, y, max_iters, info, **kwargs):
                  Severity: Minor
                  Found in prox_tv/__init__.py - About 45 mins to fix

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

                    def _condatchambollepock_tv2d(x, w, y, max_iters, info, **kwargs):
                    Severity: Minor
                    Found in prox_tv/__init__.py - About 45 mins to fix

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

                      def _yang_tv2d(x, w, y, max_iters, info, **kwargs):
                      Severity: Minor
                      Found in prox_tv/__init__.py - About 45 mins to fix

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

                        def tv1w_2d(x, w_col, w_row, max_iters=0, n_threads=1):
                        Severity: Minor
                        Found in prox_tv/__init__.py - About 35 mins to fix

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

                          def tvp_1d(x, w, p, method='gpfw', max_iters=0):
                          Severity: Minor
                          Found in prox_tv/__init__.py - About 35 mins to fix

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

                            def tv1_2d(x, w, n_threads=1, max_iters=0, method='dr'):
                            Severity: Minor
                            Found in prox_tv/__init__.py - About 35 mins to fix

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

                              def tv1_1d(x, w, method='hybridtautstring', sigma=0.05, maxbacktracks=None):
                              Severity: Minor
                              Found in prox_tv/__init__.py - About 35 mins to fix

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

                                def test_tvp_1d():
                                    """Test that all 1D-lp-TV methods produce equivalent results"""
                                    # Some of these methods are kind of unstable, so we ensure only that most
                                    # of the times the results are similar
                                    methods = ('gp', 'fw', 'gpfw')
                                Severity: Minor
                                Found in prox_tv/prox_tv_test.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