Showing 3,589 of 10,737 total issues
Function initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
initialize(): void {
this.i18nLanguageCodeService.onI18nLanguageCodeChange.subscribe(code => {
const cookieSetDateMsecs = this.cookieService.get(
this.COOKIE_NAME_COOKIES_ACKNOWLEDGED
);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function onFileChanged
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
onFileChanged(file: Blob): void {
this.invalidImageWarningIsShown = false;
let reader = new FileReader();
reader.onload = e => {
this.invalidTagsAndAttributes = {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function rejectAndReviewNext
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
rejectAndReviewNext(reviewMessage: string): void {
if (this.isUndoFeatureEnabled) {
if (
this.validatorsService.isValidReviewMessage(
reviewMessage,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function saveAsync
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async saveAsync(): Promise<void> {
if (this.nodeTitles.indexOf(this.title) !== -1) {
this.errorMsg = 'A chapter with this title already exists';
return;
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function undoReviewAction
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
undoReviewAction(): void {
clearTimeout(this.commitTimeout); // Clear the commit timeout.
if (this.queuedSuggestion) {
const indexToRemove = this.resolvedSuggestionIds.indexOf(
this.queuedSuggestion.suggestion_id
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function ngOnInit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
ngOnInit(): void {
this.contributionSubTypeText =
this.CONTRIBUTION_SUB_TYPE_TEXTS[this.contributionSubType];
if (this.contributionCount > 1) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function fetchSuggestionsAsync
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async fetchSuggestionsAsync(
fetchType: string,
limit: number | null,
offset: number,
sortKey: string,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function setNextMilestoneAndCheckIfProgressBarIsShown
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
setNextMilestoneAndCheckIfProgressBarIsShown(): boolean {
if (
!this.inStoryMode ||
this.isCompletedChaptersCountGreaterThanLastMilestone() ||
this.isMilestoneReachedAndMilestoneMessageToBeDisplayed()
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getCheckpointMessageI18nKey
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
getCheckpointMessageI18nKey(
completedCheckpointCount: number,
totalCheckpointCount: number
): string {
const messageI18nKeyPrefix = 'I18N_CONGRATULATORY_CHECKPOINT_MESSAGE';
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function onFileChanged
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
onFileChanged(file: File): void {
let originalFilename = file.name;
// The cropper always returns a jpeg file, thus the extension should be
// changed to jpeg for the final image type to match the extension.
this.croppedFilename = originalFilename
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function recordStateTransition
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
recordStateTransition(
oldStateName: string,
newStateName: string,
answer: string,
oldParams: Object,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _initializeDirectiveComponents
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private _initializeDirectiveComponents(initialCard, focusLabel): void {
this._addNewCard(initialCard);
this.nextCard = initialCard;
if (!this.explorationPlayerStateService.isInDiagnosticTestPlayerMode()) {
this.explorationPlayerStateService.onPlayerStateChange.emit(
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function generateTopicIdToSuccessorTopicIds
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
generateTopicIdToSuccessorTopicIds(): void {
// The method generates a dict with topic ID as the key and all of its
// successor topic IDs as value. The successor's list is generated using
// the prerequisite dependency graph.
// Example: A -> B -> C, here the topic ID to successor topic IDs dict will
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function save
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
save(): void {
if (!this.areRequiredFieldsFilled()) {
return;
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function onClickExploreBackwardVersionHistory
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
onClickExploreBackwardVersionHistory(): void {
this.yamlStrs.previousVersionStateYaml = '';
this.yamlStrs.currentVersionStateYaml = '';
const diffData = this.versionHistoryService.getBackwardStateDiffData();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _init
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_init(
allAudioLanguageCodesInExploration: string[],
preferredAudioLanguageCode: string | null,
explorationLanguageCode: string,
automaticTextToSpeechEnabled: boolean
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _updateGroupedSkillSummaries
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private _updateGroupedSkillSummaries(groupedSkillSummaries: {
[topicName: string]: SkillSummaryBackendDict[];
}): void {
this._groupedSkillSummaries.current = [];
this._groupedSkillSummaries.others = [];
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function onClickExploreForwardVersionHistory
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
onClickExploreForwardVersionHistory(): void {
this.yamlStrs.previousVersionStateYaml = '';
this.yamlStrs.currentVersionStateYaml = '';
const diffData = this.versionHistoryService.getForwardStateDiffData();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function generateTopicIdToAncestorTopicIds
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
generateTopicIdToAncestorTopicIds(): void {
// The method generates a dict with topic ID as the key and all of its
// ancestor topic IDs as value. The ancestor's list is generated using the
// prerequisite dependency graph.
// Example: A -> B -> C, here the topic ID to ancestor topic IDs dict will
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function onClickExploreVersionHistoryButton
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
onClickExploreVersionHistoryButton(): void {
const modalRef: NgbModalRef = this.ngbModal.open(
StateVersionHistoryModalComponent,
{
backdrop: true,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"