[pgAdmin][RM5344][Code Coverage] Improve API test cases for Grant Wizard

2020-08-19 Thread Nikhil Mohite
Hi Team,

I have added test cases for Grant wizard as per RM-5344


PFA patch for the same.



Regards,
Nikhil Mohite.


RM_5344_v1.patch
Description: Binary data


pgAdmin 4 commit: Fixed following SonarQube issues:

2020-08-19 Thread Akshay Joshi
Fixed following SonarQube issues:
 1. String literals should not be duplicated.
 2. Cognitive Complexity of functions should not be too high.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=0668a52c6bbc919c33575ebeb3e47dd71ffcb6e6
Author: Yogesh Mahajan 

Modified Files
--
.../pg_utilities_backup_restore_test.py| 129 
web/regression/feature_utils/pgadmin_page.py   | 324 -
web/regression/runtests.py | 118 +---
3 files changed, 330 insertions(+), 241 deletions(-)



pgAdmin 4 commit: Fixed cognitive complexity issues reported by SonarQu

2020-08-19 Thread Akshay Joshi
Fixed cognitive complexity issues reported by SonarQube.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=4b56962c1b72d49820f0dcc158073001363ab3ac
Author: Nikhil Mohite 

Modified Files
--
.../servers/databases/languages/__init__.py|  37 ++--
.../databases/schemas/foreign_tables/__init__.py   | 165 --
.../databases/schemas/tables/schema_diff_utils.py  | 109 +
.../servers/databases/schemas/utils.py | 246 +
.../servers/databases/schemas/views/__init__.py|  29 ++-
web/pgadmin/tools/schema_diff/directory_compare.py | 190 
6 files changed, 514 insertions(+), 262 deletions(-)



Re: Patch for SonarQube code scan fixes.

2020-08-19 Thread Akshay Joshi
Thanks, patch applied.

On Mon, Aug 17, 2020 at 11:17 AM Nikhil Mohite <
nikhil.moh...@enterprisedb.com> wrote:

> Hi Team,
>
> I have fixed some code smell issues in the SonarQube scan, PFA patch.
> Details as follows:
>
> 1. languages:
>
>- Refactor this function to reduce its Cognitive Complexity from 33 to
>the 15 allowed.
>
> 2. foreign table:
>
>- Refactor this function to reduce its Cognitive Complexity from 73 to
>the 15 allowed.
>
> 3. schema_diff_utils:
>
>- Refactor this function to reduce its Cognitive Complexity from 30 to
>the 15 allowed.
>
> 4. schema utils:
>
>- Refactor this function to reduce its Cognitive Complexity from 23 to
>the 15 allowed.
>- Refactor this function to reduce its Cognitive Complexity from 38 to
>the 15 allowed.
>
> 5. schema views:
>
>- Refactor this function to reduce its Cognitive Complexity from 18 to
>the 15 allowed.
>
> 6. schema diff directory_compare:
>
>- Refactor this function to reduce its Cognitive Complexity from 54 to
>the 15 allowed.
>- Refactor this function to reduce its Cognitive Complexity from 16 to
>the 15 allowed.
>
>

-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Sr. Software Architect*
*EDB Postgres *

*Mobile: +91 976-788-8246*


Re: [pgAdmin4][Patch] - SonarQube Issues - 14 (String literals should not be duplicated, Cognitive Complexity of functions should not be too high)

2020-08-19 Thread Akshay Joshi
Thanks, patch applied.

On Wed, Aug 12, 2020 at 8:13 PM Yogesh Mahajan <
yogesh.maha...@enterprisedb.com> wrote:

> Hello,
>
> Please find patch which fixes issues related to rule from feature test
> modules -
> 1.String literals should not be duplicated - 3 issues
> 2.Cognitive Complexity of functions should not be too high - 10 issues
>
> Thanks,
> Yogesh Mahajan
> QA - Team
> EnterpriseDB Corporation
>
> Phone: +91-9741705709
>


-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Sr. Software Architect*
*EDB Postgres *

*Mobile: +91 976-788-8246*


Re: [pgAdmin4][Patch] - SonarQube Fixes

2020-08-19 Thread Khushboo Vashi
Hi,

Please find the attached updated patch.


On Tue, Aug 4, 2020 at 12:10 PM Akshay Joshi 
wrote:

> Hi Khushboo
>
> As per offline discussion, multiple developers declaring the constant for
> the same string and error messages. To avoid that only one developer should
> work on this task.
> Suggestions:
>
>- We should have a common class for Constants (which are not module
>specific).
>
> Made a constant.py file which contains the common Constants.

>
>- For module specific constants we should not declare them as Global
>variables if possible declare them as the Class variable.
>
>
>- For common error messages(if any) we can define functions in
>PGChildNodeView.
>
> Already implemented.

> Please incorporate the changes send by Yogesh.
>
I will send another patch for Yogesh's changes as needed more changes.

Thanks,
Khushboo

>
> On Mon, Aug 3, 2020 at 1:36 PM Khushboo Vashi <
> khushboo.va...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> Please find the attached patch to fix the sonarqube code smells having
>> the rule "String literals should not be duplicated".
>>
>> Thanks,
>> Khushboo
>>
>
>
> --
> *Thanks & Regards*
> *Akshay Joshi*
> *pgAdmin Hacker | Sr. Software Architect*
> *EDB Postgres *
>
> *Mobile: +91 976-788-8246*
>


sonarqube_fixes_v1.patch
Description: Binary data


pgAdmin 4 commit: Fixed code smell 'String literals should not be dupli

2020-08-19 Thread Akshay Joshi
Fixed code smell 'String literals should not be duplicated'.

Create a constant.py file which contains the common Constants.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=cc5a7ea334cd862ee54e4bc2f35026f40ea991d5
Author: Khushboo Vashi 

Modified Files
--
web/pgadmin/browser/__init__.py| 109 ++---
web/pgadmin/browser/collection.py  |  13 +--
.../browser/register_browser_preferences.py|  43 
web/pgadmin/browser/server_groups/__init__.py  |  28 +++---
.../browser/server_groups/servers/__init__.py  |  24 ++---
.../server_groups/servers/databases/__init__.py|  11 ++-
.../servers/databases/event_triggers/__init__.py   |   9 +-
.../foreign_servers/__init__.py|  13 +--
.../foreign_servers/user_mappings/__init__.py  |  13 +--
web/pgadmin/browser/utils.py   |   7 ++
web/pgadmin/utils/constants.py |  15 +++
11 files changed, 148 insertions(+), 137 deletions(-)



Re: [pgAdmin4][Patch] - SonarQube Fixes

2020-08-19 Thread Akshay Joshi
Thanks, patch applied.

On Wed, Aug 19, 2020 at 2:01 PM Khushboo Vashi <
khushboo.va...@enterprisedb.com> wrote:

> Hi,
>
> Please find the attached updated patch.
>
>
> On Tue, Aug 4, 2020 at 12:10 PM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Hi Khushboo
>>
>> As per offline discussion, multiple developers declaring the constant for
>> the same string and error messages. To avoid that only one developer should
>> work on this task.
>> Suggestions:
>>
>>- We should have a common class for Constants (which are not module
>>specific).
>>
>> Made a constant.py file which contains the common Constants.
>
>>
>>- For module specific constants we should not declare them as Global
>>variables if possible declare them as the Class variable.
>>
>>
>>- For common error messages(if any) we can define functions in
>>PGChildNodeView.
>>
>> Already implemented.
>
>> Please incorporate the changes send by Yogesh.
>>
> I will send another patch for Yogesh's changes as needed more changes.
>
> Thanks,
> Khushboo
>
>>
>> On Mon, Aug 3, 2020 at 1:36 PM Khushboo Vashi <
>> khushboo.va...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> Please find the attached patch to fix the sonarqube code smells having
>>> the rule "String literals should not be duplicated".
>>>
>>> Thanks,
>>> Khushboo
>>>
>>
>>
>> --
>> *Thanks & Regards*
>> *Akshay Joshi*
>> *pgAdmin Hacker | Sr. Software Architect*
>> *EDB Postgres *
>>
>> *Mobile: +91 976-788-8246*
>>
>

-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Sr. Software Architect*
*EDB Postgres *

*Mobile: +91 976-788-8246*


Re: [pgAdmin4][Patch] - SonarQube Fixes #2

2020-08-19 Thread Akshay Joshi
Hi Rahul

I have committed Khushboo's patch where she has introduced a new method
'not_found_error_msg', so instead of creating a new constant
'TABLE_NOT_FOUND_MSG' use self.not_found_error_msg.

Also, instead of
_NODE_CSS = ‘node.css’
_COLLECTION_CSS = ‘collection.css’

We can use the following:
_NODE_CSS = _BROWSER_CSS_PATH + ‘/node.css’
_COLLECTION_CSS = _BROWSER_CSS_PATH + ‘/collection.css’

Make the above changes and resend the patch.

On Fri, Aug 14, 2020 at 8:34 PM Rahul Shirsat <
rahul.shir...@enterprisedb.com> wrote:

> Hi Hackers,
>
> Please find the attached patch to fix the SonarQube Code smells having
> Rule:
>
>
>1. Define a constant instead of duplicating this literal
>"browser/css/node.css" 4 times.
>2. Define a constant instead of duplicating this literal "The
>specified table could not be found." 10 times.
>3. Define a constant instead of duplicating this literal
>'get_columns_for_table.sql' 3 times.
>
> --
> *Rahul Shirsat*
> Software Engineer | EnterpriseDB Corporation.
>


-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Sr. Software Architect*
*EDB Postgres *

*Mobile: +91 976-788-8246*


Re: [pgAdmin][RM5990]: Update the style guide on pgAdmin4 website

2020-08-19 Thread Nikhil Mohite
Hi Dave/Team,

As per discussion with the UX team, Few updates on style-guide patch.
1. I have missed removing the "proposed" keyword from the "High-Contract"
theme name.
2. I have not added the "Writing Style" section in the style guide as we
don’t have the information for it (UX design is also pending due to
this). @Dave
Page  can you provide some inputs on it.


Regards,
Nikhil Mohite.

On Wed, Aug 19, 2020 at 11:40 AM Nikhil Mohite <
nikhil.moh...@enterprisedb.com> wrote:

> Hi Team,
>
> I have updated the style guide for the pgAdmin 4 website as per RM-5990
> .
> Details :
> 1. The updated style-guide section as per the new UI design.
> 2. Added new icons as per font-awesome 5.14.0.
> 3. Added custom icons of pgAdmin4.
>
> PFA the patch.
>
>
> Regards,
> Nikhil Mohite.
>