Skip to content

[BUG] LPL throwing an error #387

@Sevhena

Description

@Sevhena

Here is the smell I attempted to refactor:

Image

Maybe the **kwargs was the issue?

this is the error:

Traceback (most recent call last):
  File "C:\Users\sevhe\OneDrive - McMaster University\Year 5\SFRWENG 4G06 - Capstone\capstone--source-code-optimizer\src\ecooptimizer\api\routes\refactor_smell.py", line 103, in perform_refactoring
    modified_files: list[Path] = refactorer_controller.run_refactorer(
  File "C:\Users\sevhe\OneDrive - McMaster University\Year 5\SFRWENG 4G06 - Capstone\capstone--source-code-optimizer\src\ecooptimizer\refactorers\refactorer_controller.py", line 48, in run_refactorer
    refactorer.refactor(target_file, source_dir, smell, output_file_path, overwrite)
  File "C:\Users\sevhe\OneDrive - McMaster University\Year 5\SFRWENG 4G06 - Capstone\capstone--source-code-optimizer\src\ecooptimizer\refactorers\long_parameter_list.py", line 134, in refactor
    modified_source = astor.to_source(updated_tree)
UnboundLocalError: local variable 'updated_tree' referenced before assignment

I'd strongly suggest you install the Pylance vscode extension if you haven't already. For me your code looks like this:

Image

Image

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions