OpenJij/OpenJij

View on GitHub

Showing 379 of 379 total issues

Function sample has 12 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

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

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

      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 sample has 11 arguments (exceeds 4 allowed). Consider refactoring.
        Open

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

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

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

            Function success_probability has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            def success_probability(response, solutions, ref_energy=0, measure_with_energy=False):
                """Calculate success probability from openjij.response
            
                Args:
                    response (openjij.Response): response from solver (or sampler).
            Severity: Minor
            Found in openjij/utils/benchmark.py - About 1 hr 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 se_success_probability has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            def se_success_probability(
                response, solutions, ref_energy=0, measure_with_energy=False
            ):
                """Calculate success probability's standard error from openjij.response
            
            
            Severity: Minor
            Found in openjij/utils/benchmark.py - About 1 hr 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 _cxxjij_sampling has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                def _cxxjij_sampling(
                    self,
                    model,
                    init_generator,
                    algorithm,
            Severity: Minor
            Found in openjij/sampler/sampler.py - About 1 hr 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 _convert_validation_schedule has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                def _convert_validation_schedule(self, schedule, beta):
                    if not isinstance(schedule, (list, np.array)):
                        raise ValueError("schedule should be list or numpy.array")
            
                    if isinstance(schedule[0], cxxjij.utility.TransverseFieldSchedule):
            Severity: Minor
            Found in openjij/sampler/sqa_sampler.py - About 1 hr 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 solver_benchmark has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def solver_benchmark(
            Severity: Major
            Found in openjij/utils/benchmark.py - About 1 hr to fix

              Function sample_ising has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  def sample_ising(
                      self,
                      h,
                      J,
                      beta=None,
              Severity: Minor
              Found in openjij/sampler/chimera_gpu/gpu_sqa_sampler.py - About 55 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 make_BinaryQuadraticModel has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              def make_BinaryQuadraticModel(linear: dict, quadratic: dict, sparse):
                  """BinaryQuadraticModel factory.
              
                  Returns:
                      generated BinaryQuadraticModel class
              Severity: Minor
              Found in openjij/model/model.py - About 55 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 sample has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  def sample(self, bqm, **parameters):
                      """Sample from a binary quadratic model.
              
                      Args:
                          bqm (openjij.BinaryQuadraticModel):
              Severity: Minor
              Found in openjij/sampler/sampler.py - About 55 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 __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __init__(
              Severity: Major
              Found in openjij/sampler/chimera_gpu/gpu_sqa_sampler.py - About 50 mins to fix

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

                    def _cxxjij_sampling(
                Severity: Major
                Found in openjij/sampler/sampler.py - About 50 mins to fix

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

                  def ChimeraModel(
                  Severity: Major
                  Found in openjij/model/chimera_model.py - About 50 mins to fix

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

                            def __init__(
                    Severity: Major
                    Found in openjij/model/chimera_model.py - About 50 mins to fix

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

                              def __init__(
                      Severity: Minor
                      Found in openjij/model/king_graph.py - About 45 mins to fix

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

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

                          Avoid deeply nested control flow statements.
                          Open

                                                  if r < self.unit_num_L - 1:
                                                      edges.append(
                                                          (i, chimera_to_ind(r + 1, c, z, self.unit_num_L))
                                                      )
                          
                          
                          Severity: Major
                          Found in openjij/sampler/chimera_gpu/base_gpu_chimera.py - About 45 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language