PurplePen.Reports.MissingDescriptionBoxes C# (CSharp) Method

MissingDescriptionBoxes() private method

private MissingDescriptionBoxes ( EventDB eventDB, List unusedControls ) : List
eventDB EventDB
unusedControls List
return List
        List<MissingThing> MissingDescriptionBoxes(EventDB eventDB, List<Id<ControlPoint>> unusedControls)
        {
            List<MissingThing> missingBoxes = new List<MissingThing>();

            foreach (Id<ControlPoint> controlId in eventDB.AllControlPointIds) {
                // Go through all regular or start controls that are in use.
                if (unusedControls.Contains(controlId))
                    continue;

                ControlPoint control = eventDB.GetControl(controlId);
                if (control.kind != ControlPointKind.Normal && control.kind != ControlPointKind.Start)
                    continue;

                // If a start control is completely empty, don't process it.
                if (control.kind == ControlPointKind.Start) {
                    if (! Array.Exists(control.symbolIds, id => !string.IsNullOrEmpty(id)))
                        continue;
                }

                // Each start or normal control has 6 boxes. C==0, D==1, E==2, F==3, G==4, H==5
                Debug.Assert(control.symbolIds.Length == 6);

                if (string.IsNullOrEmpty(control.symbolIds[1])) {
                    missingBoxes.Add(new MissingThing(controlId, "D", ReportText.EventAudit_MissingD));
                }
                else if (! string.IsNullOrEmpty(control.symbolIds[3]) && string.IsNullOrEmpty(control.symbolIds[2])) {
                    missingBoxes.Add(new MissingThing(controlId, "E", ReportText.EventAudit_MissingEJunction));
                }
                else if (control.symbolIds[4] == "11.15" && string.IsNullOrEmpty(control.symbolIds[2])) {
                    missingBoxes.Add(new MissingThing(controlId, "E", ReportText.EventAudit_MissingEBetween));
                }
            }

            missingBoxes.Sort(((thing1, thing2) => QueryEvent.CompareControlIds(eventDB, thing1.controlId, thing2.controlId)));
            return missingBoxes;
        }