401
return false;
402
}
404
>
const beforeLineCount1 = sequence1.countLinesIn(before.seq1Range);
405
>
const beforeSeq1Length = before.seq1Range.length;
406
>
const beforeLineCount2 = sequence2.countLinesIn(before.seq2Range);
407
>
const beforeSeq2Length = before.seq2Range.length;
408
>
409
>
const afterLineCount1 = sequence1.countLinesIn(after.seq1Range);
410
>
const afterSeq1Length = after.seq1Range.length;
411
>
const afterLineCount2 = sequence2.countLinesIn(after.seq2Range);
412
>
const afterSeq2Length = after.seq2Range.length;
413
>
414
>
// TODO: Maybe a neural net can be used to derive the result from these numbers
415
>
416
>
const max = 2 * 40 + 50;
417
>
function cap(v: number): number {
418
>
return Math.min(v, max);
419
>
}
420
>
421
>
if (Math.pow(Math.pow(cap(beforeLineCount1 * 40 + beforeSeq1Length), 1.5) + Math.pow(cap(beforeLineCount2 * 40 + beforeSeq2Length), 1.5), 1.5)
422
>
+ Math.pow(Math.pow(cap(afterLineCount1 * 40 + afterSeq1Length), 1.5) + Math.pow(cap(afterLineCount2 * 40 + afterSeq2Length), 1.5), 1.5) > ((max ** 1.5) ** 1.5) * 1.3) {
423
return true;
424
}