Showing 123 of 288 total issues
Function generateEntities
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public generateEntities(): Note[] {
const data = [];
for (const child of this.demoChildren.entities) {
if (!child.isActive) {
Function createMatch
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
async createMatch() {
const newMatchEntity = new (this.entityRegistry.get(
this.onMatch.newEntityType,
))();
Function calculateGroupBy
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private calculateGroupBy(
properties: string[],
aggregations: any[],
label: string,
data: any[],
Function initSettings
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private initSettings() {
this.fieldIdForm = this.fb.control(this.fieldId, {
validators: [Validators.required],
asyncValidators: [
uniqueIdValidator(Array.from(this.entityType.schema.keys())),
Function createEventsIndex
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private createEventsIndex(): Promise<void> {
const designDoc = {
_id: "_design/events_index",
views: {
by_date: {
Function transformRawDataToEntities
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
async transformRawDataToEntities(
rawData: any[],
entityType: string,
columnMapping: ColumnMapping[],
): Promise<Entity[]> {
Function onDropListEntered
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
onDropListEntered({ item, container }: CdkDragEnter) {
if (container == this.placeholder) {
return;
}
const placeholderElement: HTMLElement =
Function selectDay
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
selectDay(newDate?: Date) {
if (!newDate) {
this.selectedDate = undefined;
this.selectedEvent = undefined;
this.selectedEventAttendance = undefined;
Function generateOrUpdateDetailsViewConfig
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private generateOrUpdateDetailsViewConfig(
fieldDef: ConfigFieldRaw,
entityType: string,
fieldId: string,
) {
Function recalculateStats
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
recalculateStats() {
this.individualStatusTypeCounts = new Map();
this.individualLogicalStatusCounts = new Map();
for (const event of this.events) {
- 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 alignAvailableAndSelectedEntities
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private async alignAvailableAndSelectedEntities(availableEntities: E[]) {
if (this.form.value === null || this.form.value === undefined) {
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 generateEntities
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public generateEntities(): Note[] {
const data = [];
for (const child of this.demoChildren.entities) {
if (!child.isActive) {
- 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 countPercentage
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private countPercentage(
matchingType: AttendanceLogicalStatus,
rounded: boolean = false,
) {
const calculatedStats = this.events
Function generateChildEntities
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generateChildEntities(): Child[] {
const data = [];
const a1 = new Child("1");
a1.name = "Arjun A.";
Function withState
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
static withState(
loginState = LoginState.LOGGED_IN,
data: Entity[] = [new User(TEST_USER)],
): ModuleWithProviders<MockedTestingModule> {
environment.session_type = SessionType.mock;
Function anonymizeEntity
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
async anonymizeEntity(entity: Entity): Promise<CascadingActionResult> {
if (!entity.getConstructor().hasPII) {
// entity types that are generally without PII by default retain all fields
// this should only be called through a cascade action anyway
return new CascadingActionResult();
Function generateIndexOnProperty
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
generateIndexOnProperty<
E extends Entity,
REF extends keyof E & string,
SEC extends keyof E & string,
>(
Function exportFile
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
async exportFile(data: any[], entityConstructor: EntityConstructor) {
const entitySchema = entityConstructor.schema;
const columnLabels = new Map<string, string>();
for (const [id, field] of entitySchema.entries()) {
Function generateEntities
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
generateEntities(): School[] {
const data = [];
for (let i = 1; i <= this.config.count; i++) {
const school = new School(String(i));
Function descriptionForValidator
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private descriptionForValidator(
validator: DynamicValidator | string,
validationValue: any,
): string {
switch (validator) {