Thread: Patch for SonarQube code scan fixes

Patch for SonarQube code scan fixes

From
Nikhil Mohite
Date:
Hi Team,

I have fixed some code smell issues in the SonarQube scan, PFA patch.
Details as follows:
1. Functions files:
  • Remove the unused local variable "args"
2. node.js file in browser/static:
  • "j" hides or potentially hides a variable declared in an outer scope at line 1080.
3. FTS Templates files:
  • Refactor this function to reduce its Cognitive Complexity from 22 to the 15 allowed.
4. FTS Parsers files:
  • Refactor this function to reduce its Cognitive Complexity from 22 to the 15 allowed.
  • Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.
5. FTS Dictionaries files:
  • Refactor this function to reduce its Cognitive Complexity from 25 to the 15 allowed.
  • Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.
6. FTS Configurations files:
  • Refactor this function to reduce its Cognitive Complexity from 22 to the 15 allowed.
  • Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.

Regards,
Nikhil Mohite.
Attachment

Re: Patch for SonarQube code scan fixes

From
Ashesh Vashi
Date:

On Wed, Jul 1, 2020 at 5:23 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. Functions files:
  • Remove the unused local variable "args"
2. node.js file in browser/static:
  • "j" hides or potentially hides a variable declared in an outer scope at line 1080.
This is a common file between pgAdmin & PEM.
Please send a patch to the pgadmin team. 
3. FTS Templates files:
  • Refactor this function to reduce its Cognitive Complexity from 22 to the 15 allowed.
This is a common file between pgAdmin & PEM.
Please send a patch to the pgadmin team.  
4. FTS Parsers files:
  • Refactor this function to reduce its Cognitive Complexity from 22 to the 15 allowed.
  • Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.
This is a common file between pgAdmin & PEM.
Please send a patch to the pgadmin team. 
5. FTS Dictionaries files:
  • Refactor this function to reduce its Cognitive Complexity from 25 to the 15 allowed.
  • Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.
This is a common file between pgAdmin & PEM.
Please send a patch to the pgadmin team.  
6. FTS Configurations files:
  • Refactor this function to reduce its Cognitive Complexity from 22 to the 15 allowed.
  • Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.
This is a common file between pgAdmin & PEM.
Please send a patch to the pgadmin team. 

-- Thanks, Ashesh

Regards,
Nikhil Mohite.

Re: Patch for SonarQube code scan fixes

From
Dave Page
Date:


On Wed, Jul 1, 2020 at 12:55 PM Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:

On Wed, Jul 1, 2020 at 5:23 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. Functions files:
  • Remove the unused local variable "args"
2. node.js file in browser/static:
  • "j" hides or potentially hides a variable declared in an outer scope at line 1080.
This is a common file between pgAdmin & PEM.
Please send a patch to the pgadmin team. 

That's what he did! Time for a coffee perhaps my friend? :-)
 
3. FTS Templates files:
  • Refactor this function to reduce its Cognitive Complexity from 22 to the 15 allowed.
This is a common file between pgAdmin & PEM.
Please send a patch to the pgadmin team.  
4. FTS Parsers files:
  • Refactor this function to reduce its Cognitive Complexity from 22 to the 15 allowed.
  • Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.
This is a common file between pgAdmin & PEM.
Please send a patch to the pgadmin team. 
5. FTS Dictionaries files:
  • Refactor this function to reduce its Cognitive Complexity from 25 to the 15 allowed.
  • Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.
This is a common file between pgAdmin & PEM.
Please send a patch to the pgadmin team.  
6. FTS Configurations files:
  • Refactor this function to reduce its Cognitive Complexity from 22 to the 15 allowed.
  • Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.
This is a common file between pgAdmin & PEM.
Please send a patch to the pgadmin team. 

-- Thanks, Ashesh

Regards,
Nikhil Mohite.


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: Patch for SonarQube code scan fixes

From
Ashesh Vashi
Date:


On Wed, Jul 1, 2020 at 5:28 PM Dave Page <dpage@pgadmin.org> wrote:


On Wed, Jul 1, 2020 at 12:55 PM Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:

On Wed, Jul 1, 2020 at 5:23 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. Functions files:
  • Remove the unused local variable "args"
2. node.js file in browser/static:
  • "j" hides or potentially hides a variable declared in an outer scope at line 1080.
This is a common file between pgAdmin & PEM.
Please send a patch to the pgadmin team. 

That's what he did! Time for a coffee perhaps my friend? :-)
Yes. :/

-- Ashesh 
 
3. FTS Templates files:
  • Refactor this function to reduce its Cognitive Complexity from 22 to the 15 allowed.
This is a common file between pgAdmin & PEM.
Please send a patch to the pgadmin team.  
4. FTS Parsers files:
  • Refactor this function to reduce its Cognitive Complexity from 22 to the 15 allowed.
  • Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.
This is a common file between pgAdmin & PEM.
Please send a patch to the pgadmin team. 
5. FTS Dictionaries files:
  • Refactor this function to reduce its Cognitive Complexity from 25 to the 15 allowed.
  • Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.
This is a common file between pgAdmin & PEM.
Please send a patch to the pgadmin team.  
6. FTS Configurations files:
  • Refactor this function to reduce its Cognitive Complexity from 22 to the 15 allowed.
  • Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.
This is a common file between pgAdmin & PEM.
Please send a patch to the pgadmin team. 

-- Thanks, Ashesh

Regards,
Nikhil Mohite.


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: Patch for SonarQube code scan fixes

From
Akshay Joshi
Date:
Thanks, patch applied.

On Wed, Jul 1, 2020 at 5:30 PM Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:


On Wed, Jul 1, 2020 at 5:28 PM Dave Page <dpage@pgadmin.org> wrote:


On Wed, Jul 1, 2020 at 12:55 PM Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:

On Wed, Jul 1, 2020 at 5:23 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. Functions files:
  • Remove the unused local variable "args"
2. node.js file in browser/static:
  • "j" hides or potentially hides a variable declared in an outer scope at line 1080.
This is a common file between pgAdmin & PEM.
Please send a patch to the pgadmin team. 

That's what he did! Time for a coffee perhaps my friend? :-)
Yes. :/

-- Ashesh 
 
3. FTS Templates files:
  • Refactor this function to reduce its Cognitive Complexity from 22 to the 15 allowed.
This is a common file between pgAdmin & PEM.
Please send a patch to the pgadmin team.  
4. FTS Parsers files:
  • Refactor this function to reduce its Cognitive Complexity from 22 to the 15 allowed.
  • Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.
This is a common file between pgAdmin & PEM.
Please send a patch to the pgadmin team. 
5. FTS Dictionaries files:
  • Refactor this function to reduce its Cognitive Complexity from 25 to the 15 allowed.
  • Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.
This is a common file between pgAdmin & PEM.
Please send a patch to the pgadmin team.  
6. FTS Configurations files:
  • Refactor this function to reduce its Cognitive Complexity from 22 to the 15 allowed.
  • Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.
This is a common file between pgAdmin & PEM.
Please send a patch to the pgadmin team. 

-- Thanks, Ashesh

Regards,
Nikhil Mohite.


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


--
Thanks & Regards
Akshay Joshi
Sr. Software Architect
EnterpriseDB Software India Private Limited
Mobile: +91 976-788-8246