Showing 125 of 211 total issues
Function moveElementAwayFromCollision
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function moveElementAwayFromCollision(layout, collidesWith, itemToMove, isUserAction, compactType, cols) {
Function GenerateSlotViewsAndDayColumn
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function GenerateSlotViewsAndDayColumn(
slots: ISlotViewModel[],
selectSlotChoiceHandler: (slotUid: number, newSlotChoice: number) => void,
goToThisAlternativeSlotHandler: (
sourceSlotUid: 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
Avoid deeply nested control flow statements. Open
if (indices[ptr].Value <= indices[ptr].UpperLimit) {
break;
} else {
indices[ptr].Value = 0;
snapshots.pop();
Function findOrGenerateResponsiveLayout
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function findOrGenerateResponsiveLayout(layouts, breakpoints, breakpoint, lastBreakpoint, cols, compactType) {
Function GenerateNewState
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected GenerateNewState(state: IMasterState): IMasterState {
const visualizer = state.AlgorithmVisualizerState.isEnabled
? new FindTimetableVisualizer()
: new NullFindTimetableVisualizer();
- 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 GenerateNewState
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected GenerateNewState(state: IMasterState): IMasterState {
const currentTimetable =
state.TimetableListState.FiltrateTimetables[
state.TimetableListState.CurrentIndex
];
- 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
Avoid deeply nested control flow statements. Open
if (ptr === 0) {
return result;
}
Avoid deeply nested control flow statements. Open
for (let j = Y + 1; j <= 6; j++) {
dayRows[j].rowIndex++;
}
Function calcPosition
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
GridItem.prototype.calcPosition = function calcPosition(x, y, w, h, state) {
Function GenerateSlotViewsAndDayColumn
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
slots: ISlotViewModel[],
selectSlotChoiceHandler: (slotUid: number, newSlotChoice: number) => void,
goToThisAlternativeSlotHandler: (
sourceSlotUid: number,
destinationSlotUid: number
Function Increment
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function Increment(indices: BoundedInt[]): BoundedInt[] {
let pointer = indices.length - 1;
const x = indices.slice();
while (true) {
x[pointer].Value++;
- 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 render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public render() {
const skeleton = new Skeleton();
if (this.props.slots && this.props.alternateSlots) {
// render timetable view
const slotViewsAndDayColumn = GenerateSlotViewsAndDayColumn(
- 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 render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public render() {
const subjectViews = this.props.Subjects.map((s, index) => {
if (s.IsVisible) {
return (
<div key={s.Code}>
- 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 To12HourFormat
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public To12HourFormat(withAmOrPmLabel: boolean = true): string {
let temp = this.Hour > 12 ? this.Hour - 12 : this.Hour;
if (temp === 0) {
temp = 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
Avoid too many return
statements within this function. Open
return true; // boxes overlap
Avoid too many return
statements within this function. Open
if (l1.y >= l2.y + l2.h) return false; // l1 is below l2
Function GetSlotNumbers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function GetSlotNumbers(slotState: IStringDicionary<boolean>): string[] {
const result: string[] = [];
for (const key in slotState) {
if (slotState.hasOwnProperty(key)) {
const current = slotState[key];
- 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 _extends
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
- 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 _extends
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
- 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 FindClashes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function FindClashes(
subjects: Subject[],
rawSlotStore: ObjectStore<RawSlot>
): void {
if (subjects.length < 2) {
- 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"