Skip to content

refactor/DYN-6124/code-smells#189

Merged
QilongTang merged 9 commits intoDynamoDS:masterfrom
Enzo707:refactor/DYN-6124/code-smells
Aug 21, 2023
Merged

refactor/DYN-6124/code-smells#189
QilongTang merged 9 commits intoDynamoDS:masterfrom
Enzo707:refactor/DYN-6124/code-smells

Conversation

@Enzo707
Copy link
Contributor

@Enzo707 Enzo707 commented Aug 18, 2023

after-code-smells-fixes-min (3)

This PR includes refactoring due to code smells reports.

  • Removes useless functions and commented legacy code
  • Updates according to ES6+ and javaScript recommended standards

FYI
@QilongTang
@RobertGlobant20

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Contributor

@RobertGlobant20 RobertGlobant20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with two comments.
Also did you test this changes in DynamoSandbox? Please include a GIF of your testing.

}

//call update category groups.
updateCategoryGroups(sectionElements);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this call not necesary? or is done in other place?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RobertGlobant20 Please, let me know if I'm missing something but If you look at the function declaration, it doesn't return anything that might affect the context where it is executed. Also, all the operations there are related to sectionElements which is defined as a let.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah looks like the function was disabled so no longer valid


if (pathToItem.length == 1) {
return item ? true : false;
return !!item;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you explain whyitem ? true : false;is the same than !!item;?
I know that "!" is the logical not operator but not sure why is used two times?

Copy link
Contributor Author

@Enzo707 Enzo707 Aug 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RobertGlobant20 !! operator returns the boolean value. Double NOT (!!)

}

// Get keywords from typeListNode and push them into itemData
let keywords = typeListNode.keywords.split(",");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we remove this line?

Copy link
Contributor Author

@Enzo707 Enzo707 Aug 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@QilongTang This variable is not used. The operations below this statement refers to keywords property from the ItemData class (this.keywords)

default: this.others.push(element); break;
}

var finalData = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is also not used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, it is not used.

Copy link
Contributor

@QilongTang QilongTang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one comment

@QilongTang QilongTang merged commit 54515d6 into DynamoDS:master Aug 21, 2023
@QilongTang
Copy link
Contributor

Please make the change to update librarie.js on Dynamo master branch only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants