Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pylint alerts corrections as part of intervention experiment #370

Open
evidencebp opened this issue Oct 15, 2024 · 6 comments
Open

Pylint alerts corrections as part of intervention experiment #370

evidencebp opened this issue Oct 15, 2024 · 6 comments

Comments

@evidencebp
Copy link
Contributor

I'd like to conduct a software engineering experiment regarding the benefit of Pylint alerts removal.
The experiment is described here.
In the experiments, Pylint is used with some specific alerts, files are selected for intervention and control.
After the interventions are done, one can wait and examine the results.

I'm asking for your approval for conducting an intervention in your repository.

See examples of interventions in stanford-oval/storm, gabfl/vault, and coreruleset/coreruleset.

You can see the pland interventions

@aajanki , may I do the interventions?

@evidencebp
Copy link
Contributor Author

evidencebp commented Oct 15, 2024

Please note that in yledl\downloader.py pylint alert on comparison-of-constants in line 303,
function should_skip_downloading

slicing_active = limits.start_position or 0 > 0 or limits.duration
The 0>0 is always False and can be removed.
However, it seems like an unintentional expresion, and some other expresion should have bee there.

@aajanki
Copy link
Owner

aajanki commented Oct 16, 2024

You have my permission to do the interventions :)

slicing_active = limits.start_position or 0 > 0 or limits.duration

Good catch! The intention has been to write ((limits.start_position or 0) > 0) or limits.duration. (The outer parenthesis can also be left out.) start_position can be None and it should default to 0 in that case.

@evidencebp
Copy link
Contributor Author

Thanks!

@evidencebp
Copy link
Contributor Author

@aajanki , I created a PR for the bug and also fixed too many statments alerts by extracting some functions.

I also wanted to consult you regarding yledl\extractors.py
The file has 1,230 lines when even very conservative recommendations are not to have more than 1,000. File has many classes, some related so moving them into dedicated files can reduce the length and improve structure. However, the choise of which classes to put in each file requires familarity with the project.

Are you OK with splitting the file?
If so, can you suggest a structure?

@aajanki
Copy link
Owner

aajanki commented Oct 30, 2024

I agree that extracts.py would need some work. An easy thing that you could do is to move all dataclasses (Flavors, Clip, AreenaApiProgramInfo and other classes tagged as @dataclass) to a separate file.

I guess the next step could be to move each extractor class (AreenaExtractor, AreenaLiveTVExtractor, etc.) to its own file. However, they are quite interconnected and this might take more work.

@evidencebp
Copy link
Contributor Author

AreenaLiveTVExtractor

@aajanki, I created two more files with contents from extracts.py
One for the dataclass classes and one for the Areena classes.
Can you check if the new structure makes sense?

Also, I saw that setting up the repository is a bit complicated so please not that I still did not run the project or its tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants