AndreiDrang / python-rucaptcha

Python library for RuCaptcha\2Captcha.
https://andreidrang.github.io/python-rucaptcha/
MIT License
94 stars 29 forks source link

Pylint alerts corrections as part of an intervention experiment #306

Open evidencebp opened 1 week ago

evidencebp commented 1 week ago

Is your feature request related to a problem? Please describe. The feature is not related to a problem but to code readability.

Describe the solution you'd like 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 planed interventions

May I do the interventions, @AndreiDrang ?

Describe alternatives you've considered There is a single broad-exception-caught alert and the rest are too long lines. This is not critical so an alternative will be to leave it as is. However, the PR will be easy and there will be beneit in it.

Additional context

AndreiDrang commented 1 week ago

Hi @evidencebp, lets try it.

evidencebp commented 6 days ago

I created a PR withthe changes.

Currently all of them are too long lines so rather minor. I noted similarity in the file and I guess that some of the files in the control group have similar structure. @AndreiDrang, can you please not delieretly fix them in the next few months? That will be a great oppertunity to see empirically the impace of the change on close ojects.

evidencebp commented 6 days ago

@AndreiDrang , I would like to consult you regarding the broad-exception-caught alert in src\python_rucaptcha\core\result_handler.py

Too braod exception might lead to problem if the developer planed to catch a specific exception and the exception also catchs and hides different exceptions.

Both get_sync_result (in line 34) and get_async_result (in line 63) catch Exception. I could not understand which specific exceptions should e handles there. Can you guide me? Thanks!

evidencebp commented 6 hours ago

@AndreiDrang , I got an alert that the tests fail.

I noted that the description is usually: 'errorDescription': 'The API key is missing in your request or has incorrect ' 'format.',

My PR made long lines shorter. Can you help me with that?