docs: public void build() throws OrderingConstraintException {
  
          for (DetectorFactory detectorFactory : factoryMap.values()) {
              detectorFactory.setEnabledButNonReporting(false);
          }
  
          ArrayList<DetectorOrderingConstraint> allConstraints = new ArrayList<>(
                  interPassConstraintList.size() + intraPassConstraintList.size());
          allConstraints.addAll(interPassConstraintList);
          allConstraints.addAll(intraPassConstraintList);
  
          Map<String, DetectorNode> nodeMapAll = new HashMap<>();
          ConstraintGraph allPassConstraintGraph = buildConstraintGraph(nodeMapAll,
                  new HashSet<>(factoryMap.values()), allConstraints);
          boolean change;
          do {
              change = false;
              for (Iterator<DetectorNode> i = allPassConstraintGraph.vertexIterator(); i.hasNext();) {
                  DetectorNode end = i.next();
                  if (factoryChooser.choose(end.getFactory())) {
                      for (Iterator<ConstraintEdge> j = allPassConstraintGraph.incomingEdgeIterator(end); j.hasNext();) {
                          ConstraintEdge edge = j.next();
                          DetectorNode start = edge.getSource();
                          DetectorFactory startFactory = start.getFactory();
                          //
                          // Note that we only enable an otherwise-disabled
                          // detector
                          // if it was the earlier detector in a single-source
                          // constraint.
                          //
                          if (!factoryChooser.choose(startFactory) && edge.isSingleSource()) {
                              factoryChooser.enable(startFactory);
                              change = true;
                              if (DEBUG || FindBugs2.DEBUG) {
                                  System.out.println("Dependences force enabling of " + startFactory.getFullName());
                              }
                          }
  
                      }
                  }
  
              }
          } while (change);
  
          for (Iterator<Map.Entry<String, DetectorFactory>> i = factoryMap.entrySet().iterator(); i.hasNext();) {
              Map.Entry<String, DetectorFactory> e = i.next();
              if (!factoryChooser.choose(e.getValue())) {
                  i.remove();
              }
          }
  
          // Build inter-pass constraint graph
          Map<String, DetectorNode> nodeMap = new HashMap<>();
          ConstraintGraph interPassConstraintGraph = buildConstraintGraph(nodeMap,
                  new HashSet<>(factoryMap.values()), interPassConstraintList);
          if (DEBUG) {
              System.out.println(interPassConstraintGraph.getNumVertices() + " nodes in inter-pass constraint graph");
          }
  
          // Build list of analysis passes.
          // This will assign all detectors referenced in inter- or intra-pass
          // ordering constraints to passes. Detectors with any ordering
          // constraint will be left unassigned.
          buildPassList(interPassConstraintGraph);
  
          // Sort each pass by intra-pass ordering constraints.
          // This may assign some previously unassigned detectors to passes.
          for (AnalysisPass pass : passList) {
              sortPass(intraPassConstraintList, factoryMap, pass);
          }
  
          // If there are any unassigned detectors remaining,
          // add them to the final pass.
          if (factoryMap.size() > assignedToPassSet.size()) {
              AnalysisPass lastPass;
              if (passList.isEmpty()) {
                  lastPass = new AnalysisPass();
                  addPass(lastPass);
              } else {
                  lastPass = passList.getLast();
              }
  
              Set<DetectorFactory> unassignedSet = getUnassignedSet();
              for (DetectorFactory factory : unassignedSet) {
                  assignToPass(factory, lastPass);
              }
              appendDetectorsToPass(unassignedSet, lastPass);
          }
          if (DEBUG) {
              print();
          }
      }