Обсуждение: Patch for SonarQube code scan fixes.
Hi Team,
I have fixed some code smell issues in the SonarQube scan, PFA patch.
Details as follows:
- Refactor this function to reduce its Cognitive Complexity from 32 to the 15 allowed.
- Refactor this function to reduce its Cognitive Complexity from 17 to the 15 allowed.
- Refactor this function to reduce its Cognitive Complexity from 20 to the 15 allowed.
- Refactor this function to reduce its Cognitive Complexity from 33 to the 15 allowed.
- Refactor this function to reduce its Cognitive Complexity from 26 to the 15 allowed.
- Refactor this function to reduce its Cognitive Complexity from 23 to the 15 allowed.
--
Вложения
Hi,
sqlautocomplete code is mostly inherited from the pgcli project. Changing it might create trouble in updating the code with new versions.
On Tue, Sep 8, 2020 at 2:59 PM Nikhil Mohite <nikhil.mohite@enterprisedb.com> wrote:
Hi Team,I have fixed some code smell issues in the SonarQube scan, PFA patch.Details as follows:1. psycopg2/connection:2. psycopg2/server_manager:
- Refactor this function to reduce its Cognitive Complexity from 32 to the 15 allowed.
- Refactor this function to reduce its Cognitive Complexity from 17 to the 15 allowed.
3. sqlautocomplete/parseutils:
- Refactor this function to reduce its Cognitive Complexity from 20 to the 15 allowed.
- Refactor this function to reduce its Cognitive Complexity from 33 to the 15 allowed.
- Refactor this function to reduce its Cognitive Complexity from 26 to the 15 allowed.
- Refactor this function to reduce its Cognitive Complexity from 23 to the 15 allowed.
--
Thanks,
Aditya Toshniwal
pgAdmin hacker | Sr. Software Engineer | edbpostgres.com
"Don't Complain about Heat, Plant a TREE"
On Tue, Sep 8, 2020 at 11:01 AM Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> wrote:
Hi,sqlautocomplete code is mostly inherited from the pgcli project. Changing it might create trouble in updating the code with new versions.
Send a patch upstream :-)
On Tue, Sep 8, 2020 at 2:59 PM Nikhil Mohite <nikhil.mohite@enterprisedb.com> wrote:Hi Team,I have fixed some code smell issues in the SonarQube scan, PFA patch.Details as follows:1. psycopg2/connection:2. psycopg2/server_manager:
- Refactor this function to reduce its Cognitive Complexity from 32 to the 15 allowed.
- Refactor this function to reduce its Cognitive Complexity from 17 to the 15 allowed.
3. sqlautocomplete/parseutils:
- Refactor this function to reduce its Cognitive Complexity from 20 to the 15 allowed.
- Refactor this function to reduce its Cognitive Complexity from 33 to the 15 allowed.
- Refactor this function to reduce its Cognitive Complexity from 26 to the 15 allowed.
- Refactor this function to reduce its Cognitive Complexity from 23 to the 15 allowed.
----Thanks,Aditya ToshniwalpgAdmin hacker | Sr. Software Engineer | edbpostgres.com"Don't Complain about Heat, Plant a TREE"
Hi Dave,
On Tue, Sep 8, 2020 at 3:53 PM Dave Page <dpage@pgadmin.org> wrote:
On Tue, Sep 8, 2020 at 11:01 AM Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> wrote:Hi,sqlautocomplete code is mostly inherited from the pgcli project. Changing it might create trouble in updating the code with new versions.Send a patch upstream :-)
I remember Akshay had fixed all the PEP8 issues in pgcli and sent the patch. But it was rejected by the pgcli author. :/
On Tue, Sep 8, 2020 at 2:59 PM Nikhil Mohite <nikhil.mohite@enterprisedb.com> wrote:Hi Team,I have fixed some code smell issues in the SonarQube scan, PFA patch.Details as follows:1. psycopg2/connection:2. psycopg2/server_manager:
- Refactor this function to reduce its Cognitive Complexity from 32 to the 15 allowed.
- Refactor this function to reduce its Cognitive Complexity from 17 to the 15 allowed.
3. sqlautocomplete/parseutils:
- Refactor this function to reduce its Cognitive Complexity from 20 to the 15 allowed.
- Refactor this function to reduce its Cognitive Complexity from 33 to the 15 allowed.
- Refactor this function to reduce its Cognitive Complexity from 26 to the 15 allowed.
- Refactor this function to reduce its Cognitive Complexity from 23 to the 15 allowed.
----Thanks,Aditya ToshniwalpgAdmin hacker | Sr. Software Engineer | edbpostgres.com"Don't Complain about Heat, Plant a TREE"--
Thanks,
Aditya Toshniwal
pgAdmin hacker | Sr. Software Engineer | edbpostgres.com
"Don't Complain about Heat, Plant a TREE"
On Tue, Sep 8, 2020 at 11:40 AM Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> wrote:
Hi Dave,On Tue, Sep 8, 2020 at 3:53 PM Dave Page <dpage@pgadmin.org> wrote:On Tue, Sep 8, 2020 at 11:01 AM Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> wrote:Hi,sqlautocomplete code is mostly inherited from the pgcli project. Changing it might create trouble in updating the code with new versions.Send a patch upstream :-)I remember Akshay had fixed all the PEP8 issues in pgcli and sent the patch. But it was rejected by the pgcli author. :/
Doesn't mean this one will be though - we can at least try.
On Tue, Sep 8, 2020 at 2:59 PM Nikhil Mohite <nikhil.mohite@enterprisedb.com> wrote:Hi Team,I have fixed some code smell issues in the SonarQube scan, PFA patch.Details as follows:1. psycopg2/connection:2. psycopg2/server_manager:
- Refactor this function to reduce its Cognitive Complexity from 32 to the 15 allowed.
- Refactor this function to reduce its Cognitive Complexity from 17 to the 15 allowed.
3. sqlautocomplete/parseutils:
- Refactor this function to reduce its Cognitive Complexity from 20 to the 15 allowed.
- Refactor this function to reduce its Cognitive Complexity from 33 to the 15 allowed.
- Refactor this function to reduce its Cognitive Complexity from 26 to the 15 allowed.
- Refactor this function to reduce its Cognitive Complexity from 23 to the 15 allowed.
----Thanks,Aditya ToshniwalpgAdmin hacker | Sr. Software Engineer | edbpostgres.com"Don't Complain about Heat, Plant a TREE"----Thanks,Aditya ToshniwalpgAdmin hacker | Sr. Software Engineer | edbpostgres.com"Don't Complain about Heat, Plant a TREE"
Thanks, patch applied. I haven't committed changes for "sqlautocomplete/parseutils", as Dave suggested send the patch to pgcli.
On Tue, Sep 8, 2020 at 2:59 PM Nikhil Mohite <nikhil.mohite@enterprisedb.com> wrote:
Hi Team,I have fixed some code smell issues in the SonarQube scan, PFA patch.Details as follows:1. psycopg2/connection:2. psycopg2/server_manager:
- Refactor this function to reduce its Cognitive Complexity from 32 to the 15 allowed.
- Refactor this function to reduce its Cognitive Complexity from 17 to the 15 allowed.
3. sqlautocomplete/parseutils:
- Refactor this function to reduce its Cognitive Complexity from 20 to the 15 allowed.
- Refactor this function to reduce its Cognitive Complexity from 33 to the 15 allowed.
- Refactor this function to reduce its Cognitive Complexity from 26 to the 15 allowed.
- Refactor this function to reduce its Cognitive Complexity from 23 to the 15 allowed.
--
--
Thanks & Regards
Akshay Joshi
pgAdmin Hacker | Sr. Software Architect
EDB PostgresMobile: +91 976-788-8246