Showing 10,782 of 10,782 total issues
Function ngOnInit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
ngOnInit(): void {
// Reset the component each time the value changes (e.g. if this is
// part of an editable list).
this.svgString = '';
this.numberOfElementsInQueue = 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 keyDownCallBack
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
keyDownCallBack(e: KeyboardEvent): void {
if (this.isCustomizationArgOpen()) {
let keyPressed = e.key;
if (keyPressed === 'Shift') {
this.lettersAreLowercase = false;
- 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 regionLabelSetter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
regionLabelSetter(label: string): void {
if (this.utilsService.isDefined(label)) {
if (this.selectedRegion !== null) {
this.value.labeledRegions[this.selectedRegion].label = label;
}
- 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 getCustomizationArgContents
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static getCustomizationArgContents(
customizationArgs: InteractionCustomizationArgs
): (SubtitledUnicode | SubtitledHtml)[] {
const contents: (SubtitledUnicode | SubtitledHtml)[] = [];
- 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 fromRawInputString
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static fromRawInputString(rawInput: string): Ratio {
if (rawInput.length === 0) {
throw new Error(
ObjectsDomainConstants.RATIO_PARSING_ERROR_I18N_KEYS.EMPTY_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 validate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
validate(): string[] {
let issues = [];
let validTitleRegex: RegExp = new RegExp(
AppConstants.VALID_BLOG_POST_TITLE_REGEX
);
- 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 constructor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
constructor(
public readonly explorationId: string,
public readonly explorationVersion: number,
public readonly improvementsTabIsEnabled: boolean,
public readonly highBounceRateTaskStateBounceRateCreationThreshold: number,
- 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 unitToList
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
unitToList(unitsWithMultiplier: [string, number][]): Unit[] {
var unitDict: UnitsDict = {};
for (var i = 0; i < unitsWithMultiplier.length; i++) {
var unit = unitsWithMultiplier[i][0];
var multiplier = unitsWithMultiplier[i][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 refreshStatus
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public refreshStatus(topStateAnswersStats: readonly AnswerStats[]): void {
const numUnaddressedTopStateAnswers = topStateAnswersStats.filter(
a => !a.isAddressed
).length;
if (numUnaddressedTopStateAnswers === 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 onKeypress
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
onKeypress(evt: KeyboardEvent): void {
if (evt.keyCode === 13) {
if (
this.floatForm.form.controls.floatValue.errors !== null &&
Object.keys(this.floatForm.form.controls.floatValue.errors).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 ngOnInit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
ngOnInit(): void {
if (this.uiConfig && this.uiConfig.coding_mode) {
// Flag that is flipped each time the codemirror view is
// shown. (The codemirror instance needs to be refreshed
// every time it is unhidden.)
- 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 transform
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
transform(input: number): number | string {
// Nine zeros for billions (e.g. 146008788788 --> 146.0B).
// Six zeros for millions (e.g. 146008788 --> 146.0M).
// Three zeros for thousands (e.g. 146008 --> 146.0K).
// No change for small numbers (e.g. 12 --> 12).
- 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 parseInput
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
parseInput(): void {
// If input is empty, the number value should be null.
if (this.localStringValue === '') {
this.localValue = null;
// Clear errors if input is empty.
- 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(): void {
this.stateEditorService.setStateNames([]);
this.stateEditorService.setInQuestionMode(true);
if (this.question) {
this.stateEditorService.setInapplicableSkillMisconceptionIds(
- 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 {
this.uploadedImageMimeType = file.type;
this.invalidImageWarningIsShown = false;
this.invalidFilenameWarningIsShown = false;
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 transform
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
transform(input: string, maxNumberOfCharacters: number): string {
if (!input) {
return input;
}
// The following regexp match will only return 'null' on an empty input
- 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 _onChildFormSubmit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_onChildFormSubmit(): void {
if (!this.isAddItemButtonPresent) {
/**
* If form submission happens on last element of the set (i.e
* the add item button is absent) then automatically add the
- 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 updateSvgInViewIfSafe
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
updateSvgInViewIfSafe(): void {
// If the SVG image is passed as base64 data.
if (this.imgSrc.indexOf('data:image/svg+xml;base64') === 0) {
const safeResourceUrl = this.svgSanitizerService.getTrustedSvgResourceUrl(
this.imgSrc
- 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 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"