tadashi-aikawa/jumeaux

View on GitHub

Showing 22 of 22 total issues

File executor.py has 769 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import hashlib
import io
Severity: Major
Found in jumeaux/executor.py - About 1 day to fix

    File main.py has 342 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    #!/usr/bin/env python
    # -*- coding: utf-8 -*-
    import glob
    import os
    import shutil
    Severity: Minor
    Found in e2e/main.py - About 4 hrs to fix

      Function segment has 90 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              TinySegmenter.prototype.segment = function(input) {
                if (input == null || input == undefined || input == "") {
                  return [];
                }
                var result = [];
      Severity: Major
      Found in docs/assets/javascripts/lunr/tinyseg.js - About 3 hrs to fix

        Function challenge has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

        def challenge(arg_dict: dict) -> dict:
            """
            [[[ WARNING !!!!! ]]]
            `arg_dict` is dict like `ChallengeArg` because HttpMethod(OwlEnum) can't be pickled.
            Return value is dict like `Trial` because Status(OwlEnum) can't be pickled.
        Severity: Minor
        Found in jumeaux/executor.py - About 2 hrs 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

        File models.py has 267 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        import datetime
        from typing import Any, List, Optional
        
        from owlmixin import OwlEnum, OwlMixin, TDict, TList, TOption
        Severity: Minor
        Found in jumeaux/models.py - About 2 hrs to fix

          Function challenge has 57 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          def challenge(arg_dict: dict) -> dict:
              """
              [[[ WARNING !!!!! ]]]
              `arg_dict` is dict like `ChallengeArg` because HttpMethod(OwlEnum) can't be pickled.
              Return value is dict like `Trial` because Status(OwlEnum) can't be pickled.
          Severity: Major
          Found in jumeaux/executor.py - About 2 hrs to fix

            Function TinySegmenter has 57 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    function TinySegmenter() {
                      var patterns = {
                        "[一二三四五六七八九十百千万億兆]":"M",
                        "[一-龠々〆ヵヶ]":"H",
                        "[ぁ-ん]":"I",
            Severity: Major
            Found in docs/assets/javascripts/lunr/tinyseg.js - About 2 hrs to fix

              Function exec has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  def exec(
                      self, payload: FinalAddOnPayload, reference: FinalAddOnReference
                  ) -> FinalAddOnPayload:
                      if When.NOT_EMPTY in self.config.when and payload.report.trials.size() == 0:
                          logger.info_lv1("Skip sending results to Miroir because trials are empty.")
              Severity: Minor
              Found in jumeaux/addons/final/miroir.py - About 2 hrs 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 config_generator has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

              def config_generator(blockstr: str, header_regexp: str, record_regexp: str):
                  key = None
                  d: dict = {}
              
                  # XXX: [""] means for the case which last line break is nothing
              Severity: Minor
              Found in jumeaux/addons/res2dict/block.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 concurrent_request has 13 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def concurrent_request(
              Severity: Major
              Found in jumeaux/executor.py - About 1 hr to fix

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

                def judgement(
                Severity: Major
                Found in jumeaux/executor.py - About 1 hr to fix

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

                  def run(args: Args):
                      init_logger(0)
                  
                      # TODO: refactoring
                      if args.name.get() == "addon":
                  Severity: Minor
                  Found in jumeaux/commands/init/main.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 clean has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def clean(self, values):
                          keys = list(values.keys())
                          for k in keys:
                              v = values[k]
                              if isinstance(v, str):
                  Severity: Minor
                  Found in jumeaux/addons/parser.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 exec has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def exec(
                          self, payload: FinalAddOnPayload, reference: FinalAddOnReference
                      ) -> FinalAddOnPayload:
                          if When.NOT_EMPTY in self.config.when and payload.report.trials.size() == 0:
                              logger.info_lv1("Skip sending results to Miroir because trials are empty.")
                  Severity: Minor
                  Found in jumeaux/addons/final/miroir.py - About 1 hr to fix

                    Function exec has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def exec(self, payload: Res2ResAddOnPayload) -> Res2ResAddOnPayload:
                            res: Response = payload.response
                    
                            if res.type != "json":
                                logger.info_lv3(f"{LOG_PREFIX} Skipped because this response is not json.")
                    Severity: Minor
                    Found in jumeaux/addons/res2res/json_sort.py - About 45 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 a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def __init__(self, addons: Addons) -> None:
                            self.log2reqs = create_addon(addons.log2reqs, "log2reqs")
                            self.reqs2reqs = (
                                addons.reqs2reqs.map(lambda x: create_addon(x, "reqs2reqs"))
                                if addons
                    Severity: Minor
                    Found in jumeaux/addons/__init__.py - About 45 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 store_criterion has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def store_criterion(
                    Severity: Minor
                    Found in jumeaux/executor.py - About 35 mins to fix

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

                      def __run(
                      Severity: Minor
                      Found in jumeaux/executor.py - About 35 mins to fix

                        Function create_config has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def create_config(config_paths: TList[str], skip_tags: TOption[TList[str]]) -> Config:
                            def filter_by_tags(addons: List[dict]) -> List[dict]:
                                return [
                                    x
                                    for x in addons
                        Severity: Minor
                        Found in jumeaux/domain/config/service.py - About 35 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 merge_args2config has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def merge_args2config(args: MergedArgs, config: Config) -> Config:
                            return Config.from_dict(
                                {
                                    "one": config.one,
                                    "other": config.other,
                        Severity: Minor
                        Found in jumeaux/domain/config/service.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