OpenJij/OpenJij

View on GitHub
openjij/sampler/csqa_sampler.py

Summary

Maintainability
A
2 hrs
Test Coverage
F
27%

Function sample_ising has 11 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def sample_ising(
Severity: Major
Found in openjij/sampler/csqa_sampler.py - About 1 hr to fix

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

        def __init__(
    Severity: Minor
    Found in openjij/sampler/csqa_sampler.py - About 35 mins to fix

      Method "sample_ising" has 12 parameters, which is greater than the 7 authorized.
      Open

              self,
              h,
              J,
              beta=None,
              gamma=None,

      A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

      Noncompliant Code Example

      With a maximum number of 4 parameters:

      def do_something(param1, param2, param3, param4, param5):
          ...
      

      Compliant Solution

      def do_something(param1, param2, param3, param4):
          ...
      

      Line too long (80 > 79 characters)
      Open

                  bqm, init_generator, algorithm, sqa_system, reinitialize_state, seed
      Severity: Minor
      Found in openjij/sampler/csqa_sampler.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.

      Line too long (81 > 79 characters)
      Open

                  algorithm = cxxjij.algorithm.Algorithm_ContinuousTimeSwendsenWang_run
      Severity: Minor
      Found in openjij/sampler/csqa_sampler.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.

      Line too long (104 > 79 characters)
      Open

                      >>> Q = {(0, 0): -1, (1, 1): -1, (2, 2): 1, (3, 3): 1, (4, 4): 1, (0, 1): -1, (3, 4): 1}
      Severity: Minor
      Found in openjij/sampler/csqa_sampler.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.

      Line too long (101 > 79 characters)
      Open

                  reinitialize_state (bool, optional): Re-initilization at each sampling. Defaults to True.
      Severity: Minor
      Found in openjij/sampler/csqa_sampler.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.

      There are no issues that match your filters.

      Category
      Status