/// <summary> /// A message presented to the user if this Dependency has a <see cref="BadCt"/>or <see cref="QuestionableCt"/>. /// </summary> /// <returns></returns> public string NotOkMessage(bool simpleRuleOutput, bool newLine, int maxLength = 600) { if (simpleRuleOutput) { return($"{UsingItem.AsString()} ---? {UsedItem.AsString()}"); } else { string prefix = BadCt > 0 ? QuestionableCt > 0 ? "Bad and questionable d" : "Bad d" : QuestionableCt > 0 ? "Questionable d" : "D"; string nounTail = Ct > 1 ? "ependencies" : "ependency"; string reason = string.IsNullOrWhiteSpace(NotOkReason) ? "" : " detected by " + NotOkReason; string brk = newLine ? Environment.NewLine + " " : ""; string ct = BadCt > 0 ? QuestionableCt > 0 ? $";{QuestionableCt};{BadCt}" : $";;{BadCt}" : QuestionableCt > 0 ? $";{QuestionableCt};" : ";;"; string markers = MarkerSet.AsFullString(maxLength / 3); return ($"{prefix}{nounTail}{reason}: {brk}{UsingItem.AsFullString(maxLength / 3)}{brk}-- {ct}{markers}{brk}-> {UsedItem.AsFullString(maxLength / 3)}" + (Source != null ? $" {brk}" + (Ct > 1 ? "(e.g. at " : "(at ") + Source + ")" : "") + (newLine ? Environment.NewLine : "")); } }