Edit in JSFiddle
JavaScript
const SAMPLE_SIZE = 30; // no of lines const INDENT_COUNT_THRESHOLD = 20; // percentage