ak-gupta/bayte

View on GitHub

Showing 27 of 27 total issues

Avoid too many return statements within this function.
Open

            return GradientBoostingClassifier(random_state=seed)
Severity: Major
Found in experiments/tasks/model.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return LGBMClassifier(random_state=seed)
    Severity: Major
    Found in experiments/tasks/model.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return TargetEncoder()
      Severity: Major
      Found in experiments/tasks/encode.py - About 30 mins to fix

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

        def _init_prior(dist: str, y) -> Tuple:
            """Initialize the prior distribution based on the input likelihood.
        
            Parameters
            ----------
        Severity: Minor
        Found in bayte/encoder.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

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

        def _update_posterior(y, mask, dist, params) -> Tuple:
            """Generate the parameters for the posterior distribution.
        
            Parameters
            ----------
        Severity: Minor
        Found in bayte/encoder.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

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

        def fit_encoder(
            data: pd.DataFrame,
            metadata: Dict,
            encoder,
            estimator=None,
        Severity: Minor
        Found in experiments/tasks/encode.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

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

        def sample(dataset, algorithm, n_estimators, seeds):
            """Run the sampling experiment."""
            for n_est in n_estimators:
                for seed in seeds:
                    click.echo(
        Severity: Minor
        Found in run_experiments.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