Showing 3,604 of 10,782 total issues
Function generateIdForComponent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
generateIdForComponent(
existingComponentIds: string[],
componentName: string
): string {
let contentIdList = JSON.parse(JSON.stringify(existingComponentIds));
- 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 getIssueURL
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
getIssueURL(invalidTagsAndAttributes: {
tags: string[];
attrs: string[];
}): string {
const invalidTags = invalidTagsAndAttributes.tags;
- 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 intercept
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
intercept(
request: HttpRequest<FormData>,
next: HttpHandler
): Observable<HttpEvent<FormData>> {
var csrf = this.csrf;
- 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 summarizeAnswerGroup
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
summarizeAnswerGroup(
answerGroup: AnswerGroup,
interactionId: string,
answerChoices: AnswerChoice[],
shortenRule: 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 insertMultiplicationSigns
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
insertMultiplicationSigns(expressionString: string): string {
let greekLetters = Object.keys(AppConstants.GREEK_LETTER_NAMES_TO_SYMBOLS);
let greekSymbols = Object.values(
AppConstants.GREEK_LETTER_NAMES_TO_SYMBOLS
);
- 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 getFilenameToBase64MappingAsync
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async getFilenameToBase64MappingAsync(
imagesData: ImagesData[]
): Promise<Record<string, string>> {
let filesToBase64Mapping: {[key: string]: string} = {};
if (imagesData.length > 0) {
- 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 evaluate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
evaluate(parsed: Expr | Expr[], envs: EnvDict[]): Expr {
// The intermediate nodes of the parse tree are arrays. The terminal nodes
// are JavaScript primitives (as described in the "Parser output" section of
// parser.pegjs).
if (parsed instanceof Array) {
- 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 updateSearchFieldsBasedOnUrlQuery
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
updateSearchFieldsBasedOnUrlQuery(urlComponent: string): UrlSearchQuery {
let newSearchQuery: UrlSearchQuery = {
searchQuery: '',
selectedTags: [],
};
- 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 onStateRenamed
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
onStateRenamed(oldStateName: string, newStateName: string): void {
this.expStats = this.expStats.createNewWithStateRenamed(
oldStateName,
newStateName
);
- 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 getQueryFieldValuesAsList
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
getQueryFieldValuesAsList(fieldName: string): string[] {
let fieldValues = [];
if (this.getCurrentQueryString().indexOf('?') > -1) {
// Each queryItem return one field-value pair in the url.
let queryItems = this.getCurrentQueryString()
- 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 subtopicMasteryPosition
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
subtopicMasteryPosition(i: number): number {
if (this.clientWidth > 510) {
if (this.subtopicMasteryArray[i] <= 89) {
return 225 - this.subtopicMasteryArray[i] * 2.5;
}
- 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 convertImageDataToImageFile
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
convertImageDataToImageFile(dataURI: string | null): Blob | null {
// Convert base64/URLEncoded data component to raw binary data
// held in a string.
if (dataURI !== null) {
let byteString = atob(dataURI.split(',')[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 save
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
save(): void {
if (!this.newTitle) {
this.alertsService.addWarning('Please specify a title');
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 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 saveLearnerGroupInfo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
saveLearnerGroupInfo(): void {
if (this.newLearnerGroupTitle || this.newLearnerGroupDescription) {
this.learnerGroup.title = this.newLearnerGroupTitle
? this.newLearnerGroupTitle
: this.learnerGroup.title;
- 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 getSafeReturnUrl
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
getSafeReturnUrl(urlString: string): string {
try {
// Make sure the URL can be decoded properly.
urlString = decodeURIComponent(urlString);
} catch (_) {
- 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 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 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 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"