Showing 128 of 288 total issues
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 applyChanges
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private async applyChanges(externallyUpdatedEntity: T) {
if (this.formIsUpToDate(externallyUpdatedEntity)) {
Object.assign(this.entity, externallyUpdatedEntity);
return;
}
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 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 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 testEntitySubclass
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function testEntitySubclass(
entityType: string,
entityClass: EntityConstructor,
expectedDatabaseFormat: any,
skipTestbedConfiguration = false,
Function login
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
async login(): Promise<SessionInfo> {
if (!this.keycloakInitialised) {
this.keycloakInitialised = true;
const loggedIn = await this.keycloak.init({
config: window.location.origin + "/assets/keycloak.json",
Function constructor
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(components: ComponentRegistry) {
components.addAll([
[
"Import",
() =>
Function generateChildSchoolRelationEntities
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generateChildSchoolRelationEntities(): ChildSchoolRelation[] {
const data: ChildSchoolRelation[] = [];
const rel1: ChildSchoolRelation = new ChildSchoolRelation("1");
rel1.childId = "Child:1";
rel1.schoolId = "School:1";
Function generateAserResultsForChild
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private generateAserResultsForChild(child: Child): Aser[] {
const data = [];
let date = new Date(child.admissionDate.getTime());
let previousResult = new Aser("");
Function initSideDetails
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private async initSideDetails(
side: MatchingSideConfig,
sideIndex: number,
): Promise<MatchingSide> {
const newSide = Object.assign({}, side) as MatchingSide; // we are transforming it into this type here
- 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 getValidator
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private getValidator(
key: DynamicValidator,
value: any,
):
| { async?: false; fn: ValidatorFn }
- 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 getEntityTypesReferencingType
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
getEntityTypesReferencingType(type: string): {
entityType: EntityConstructor;
referencingProperties: string[];
}[] {
const referencingTypes = [];
- 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 drop
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
drop(event: CdkDragDrop<ColumnConfig[], ColumnConfig[]>) {
const prevFieldsArray = event.previousContainer.data;
const newFieldsArray = event.container.data;
if (
Function loadAttendanceOfAbsentees
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private async loadAttendanceOfAbsentees() {
const previousMonday = moment()
.startOf("isoWeek")
.subtract(1, "week")
.add(this.daysOffset, "days");
Function getAttendanceReport
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private getAttendanceReport(
attendances: AttendanceInfo[],
): AttendanceReport[] {
const participantMap: { [key in string]: AttendanceReport } = {};
attendances.forEach((attendance) => {
Function loadActivities
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private async loadActivities() {
this.allActivities = await this.entityMapper
.loadType(RecurringActivity)
.then((res) => res.filter((a) => a.isActive));
Function generateHealthCheckHistoryForChild
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private generateHealthCheckHistoryForChild(child: Child): HealthCheck[] {
const data = [];
let date = new Date(child.admissionDate.getTime());
let previousRecord = new HealthCheck("");
Function icon
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Input() set icon(icon: string) {
if (!icon) {
this._icon = undefined;
return;
}
Function generateEntities
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected generateEntities(): HistoricalEntityData[] {
const config = this.configGenerator.entities[0];
const attributes: any[] = Object.keys(
(
config.data[