vertfn
v1.1.2
免責聲明:誤報;實際上,這對於“探索”而不是“執行”很有用
垂直訂購
通常,我們希望函數調用依賴項指向向下方向。也就是說,稱為稱為調用的函數應為ballow。這會從高級別到低水平的源代碼模塊下方創建一個不錯的流量。與報紙文章一樣,我們期望最重要的概念第一,我們希望它們能以最少的污染細節來表達。我們希望低級細節將持續下去。這使我們能夠瀏覽源文件,從少數功能中獲取要點,而無需將自己沉浸在細節中。
- 清潔代碼,第5章,P84,Robert C. Martin,2009年

go install github . com / nikolaydubina / vertfn @ latest vertfn --verbose ./...
提高誤報率是好的,例如以下情況:
清潔代碼,第5章,代碼示例WikiPageResponder.java
public class WikiPageResponder implements SecureResponder {
protected WikiPage page ;
protected PageData pageData ;
protected String pageTitle ;
protected Request request ;
protected PageCrawler crawler ;
public Response makeResponse ( FitNesseContext context , Request request )
throws Exception {
String pageName = getPageNameOrDefault ( request , "FrontPage" );
loadPage ( pageName , context );
if ( page == null )
return notFoundResponse ( context , request );
else
return makePageResponse ( context );
}
private String getPageNameOrDefault ( Request request , String defaultPageName )
{
String pageName = request . getResource ();
if ( StringUtil . isBlank ( pageName ))
pageName = defaultPageName ;
return pageName ;
}
protected void loadPage ( String resource , FitNesseContext context )
throws Exception {
WikiPagePath path = PathParser . parse ( resource );
crawler = context . root . getPageCrawler ();
crawler . setDeadEndStrategy ( new VirtualEnabledPageCrawler ());
page = crawler . getPage ( context . root , path );
if ( page != null )
pageData = page . getData ();
}
private Response notFoundResponse ( FitNesseContext context , Request request )
throws Exception {
return new NotFoundResponder (). makeResponse ( context , request );
}
private SimpleResponse makePageResponse ( FitNesseContext context )
throws Exception {
pageTitle = PathParser . render ( crawler . getFullPath ( page ));
String html = makeHtml ( context );
SimpleResponse response = new SimpleResponse ();
response . setMaxAge ( 0 );
response . setContent ( html );
return response ;
}
...
}