void (DetectionExcludesConfiguration configuration) { Collection<? extends VirtualFile> files = myDescription.getRelatedFiles(); FrameworkType frameworkType = myDescription.getDetector().getFrameworkType(); if (files.size() <= 5) { for (VirtualFile file : files) { configuration.addExcludedFile(file, frameworkType); } } else { VirtualFile commonAncestor = VfsUtil.getCommonAncestor(files); if (commonAncestor != null) { configuration.addExcludedFile(commonAncestor, frameworkType); } else { LOG.info("Cannot find common ancestor for " + files.size() + " files, disabling detection for " + frameworkType.getId() + " in the whole project"); configuration.addExcludedFramework(frameworkType); } } }