Skip to content

Commit 0f7ad6c

Browse files
author
Gonzalo Diaz
committed
[BUGFIX] sonarqube: Prefer class field declaration over this assignment in constructor for static values.
Class properties should be declared as fields rather than assigned in constructors typescript:S7757
1 parent ff80e60 commit 0f7ad6c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/hackerrank/interview_preparation_kit/sort/ctci_bubble_sort.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ const SEPARATOR = '\n';
77
class SortableGroup {
88
group: number[];
99

10-
count: number;
10+
count = 0;
1111

1212
constructor(group: number[]) {
13-
this.count = 0;
1413
this.group = group;
1514
}
1615

src/hackerrank/interview_preparation_kit/sort/ctci_comparator_sorting.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,5 @@ export default {
5353
comparatorSortingPrint
5454
};
5555

56-
export { Player, SortablePlayer, comparatorSorting, comparatorSortingPrint };
56+
export { Player } from './ctci_comparator_sorting.Player';
57+
export { SortablePlayer, comparatorSorting, comparatorSortingPrint };

0 commit comments

Comments
 (0)