HunterMcGushion/hyperparameter_hunter

View on GitHub
hyperparameter_hunter/i_o/result_reader.py

Summary

Maintainability
C
1 day
Test Coverage

Function validate_fe_steps has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

def validate_fe_steps(
    candidate: Union[list, FeatureEngineer], template: Union[list, FeatureEngineer]
) -> list:
    """Check `candidate` "feature_engineer" `steps` compatibility with `template` and sanitize
    `candidate`
Severity: Minor
Found in hyperparameter_hunter/i_o/result_reader.py - About 3 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 has_experiment_result_file has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

def has_experiment_result_file(results_dir, experiment_id, result_type=None):
    """Check if the specified result files exist in `results_dir` for Experiment `experiment_id`

    Parameters
    ----------
Severity: Minor
Found in hyperparameter_hunter/i_o/result_reader.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 does_match_guidelines has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def does_match_guidelines(
    candidate_params: dict,
    space: Space,
    template_params: dict,
    visitors=(),
Severity: Minor
Found in hyperparameter_hunter/i_o/result_reader.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 does_match_init_params_guidelines_multi has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def does_match_init_params_guidelines_multi(self, exp_id, params, score, location) -> bool:
        """Check candidate compatibility with `model_init_params` template guidelines when a
        guideline hyperparameter is directly affected by another hyperparameter that is given as
        a space choice

Severity: Minor
Found in hyperparameter_hunter/i_o/result_reader.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 find has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def find(self):
        """Execute full result-finding workflow, populating :attr:`similar_experiments`

        See Also
        --------
Severity: Minor
Found in hyperparameter_hunter/i_o/result_reader.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

There are no issues that match your filters.

Category
Status