Re: [pgAdmin][SonarQube]: Cognitive complexity

From: Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com>
To: Pradip Parkale <pradip(dot)parkale(at)enterprisedb(dot)com>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: [pgAdmin][SonarQube]: Cognitive complexity
Date: 2020-08-21 06:23:20
Message-ID: CANxoLDc7RcMr7nhHBb2djRxKqshtV85ydh_rXFUkPUDQjvpeyA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi Pradip

Following are the review comments:

- Change the function name to "_get_supported_browser" instead of
"_get_browser_supported".
- Added docstring to the functions in below format:

"""

<description>

:param trans_id:
:param session_obj:
:param diff_model_obj:
:return:
"""

- Can we make "_check_cascade_operation" to generic or move that
function to PGChildNodeView class and update it in all the nodes where it
is used.

On Thu, Aug 20, 2020 at 8:56 PM Pradip Parkale <
pradip(dot)parkale(at)enterprisedb(dot)com> wrote:

> Please ignore the previous patch, find the updated patch in this mail.
>
> On Thu, Aug 20, 2020 at 8:52 PM Pradip Parkale <
> pradip(dot)parkale(at)enterprisedb(dot)com> wrote:
>
>> Hi Hackers,
>>
>> The attached patch will reduce cognitive complexity for the following
>> functions.
>>
>> 1. web/.../databases/schemas/domains/__init__.py - 16 to 15.
>> 2. web/.../tables/row_security_policies/__init__.py - 17 to 15.
>> 3. web/pgadmin/tools/debugger/__init__.py - 23 to 15
>> 4. user_mapping/__init__.py. 35 to 15.
>> 5. browser/__init__.py.
>>
>>
>> --
>> Thanks & Regards,
>> Pradip Parkale
>> Software Engineer | EnterpriseDB Corporation
>>
>
>
> --
> Thanks & Regards,
> Pradip Parkale
> Software Engineer | EnterpriseDB Corporation
>

--
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Sr. Software Architect*
*EDB Postgres <http://edbpostgres.com>*

*Mobile: +91 976-788-8246*

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Nikhil Mohite 2020-08-21 06:53:36 Patch for SonarQube code scan fixes.
Previous Message Nikhil Mohite 2020-08-21 04:58:47 Re: [pgAdmin][RM5990]: Update the style guide on pgAdmin4 website