Sonarcloud issues fixes (#3499)

* Sonarcloud issues fixes

* Code smell fixes

* Refactoring to remove new code duplications

* Sonarcloud code smell fixes part I

* Sonarcloud code smell fixes part II

* Missing code smell fix

* Add new ESLint rules to cover fixed SonarCloud issues

* Add missing command

* Add missing is existing check
This commit is contained in:
MichalKinas
2023-11-03 06:43:06 -04:00
committed by GitHub
parent 968febffb0
commit 69c00fc403
72 changed files with 327 additions and 530 deletions
@@ -52,6 +52,4 @@ export class NavigateToParentFolder implements Action {
export class NavigateToPreviousPage implements Action {
readonly type = RouterActionTypes.NavigateToPreviousPage;
constructor() {}
}
@@ -32,7 +32,6 @@ export enum SearchActionTypes {
export class SearchAction implements Action {
readonly type = SearchActionTypes.Search;
constructor() {}
}
export class SearchByTermAction implements Action {
@@ -28,14 +28,10 @@ import { TemplateActionTypes } from './template-action-types';
export class FileFromTemplate implements Action {
readonly type = TemplateActionTypes.FileFromTemplate;
constructor() {}
}
export class FolderFromTemplate implements Action {
readonly type = TemplateActionTypes.FolderFromTemplate;
constructor() {}
}
export class CreateFromTemplate implements Action {
@@ -67,7 +67,7 @@ export class RouterEffects {
this.actions$.pipe(
ofType<NavigateToFolder>(RouterActionTypes.NavigateFolder),
map((action) => {
if (action.payload && action.payload.entry) {
if (action.payload?.entry) {
this.navigateToFolder(action.payload.entry);
}
})
@@ -80,7 +80,7 @@ export class RouterEffects {
this.actions$.pipe(
ofType<NavigateToParentFolder>(RouterActionTypes.NavigateParentFolder),
map((action) => {
if (action.payload && action.payload.entry) {
if (action.payload?.entry) {
this.navigateToParentFolder(action.payload.entry);
}
})
@@ -101,7 +101,7 @@ export class RouterEffects {
let link: any[] = null;
const { path, id } = node;
if (path && path.name && path.elements) {
if (path?.name && path?.elements) {
const isLibraryPath = this.isLibraryContent(path);
const parent = path.elements[path.elements.length - 1];
@@ -126,7 +126,7 @@ export class RouterEffects {
let link: any[] = null;
const { path } = node;
if (path && path.name && path.elements) {
if (path?.name && path?.elements) {
const isLibraryPath = this.isLibraryContent(path);
const parent = path.elements[path.elements.length - 1];