资源简介
这是一个 Sonar 的插件,实现对 Objective-C 语言的分析。可分析角度包括:
Complexity
Design
Documentation
Duplications
Issues
Size
Tests
标签:Sonar
标签:Sonar
代码片段和文件信息
/*
* Sonar objective-C Plugin
* Copyright (C) 2012 OCTO Technology
* dev@sonar.codehaus.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not write to the Free Software
* Foundation Inc. 51 Franklin Street Fifth Floor Boston MA 02
*/
package org.sonar.objectivec;
import java.io.File;
import java.util.Collection;
import org.sonar.objectivec.api.objectiveCGrammar;
import org.sonar.objectivec.api.objectiveCMetric;
import org.sonar.objectivec.parser.objectiveCParser;
import org.sonar.squidbridge.AstScanner;
import org.sonar.squidbridge.CommentAnalyser;
import org.sonar.squidbridge.SquidAstVisitor;
import org.sonar.squidbridge.SquidAstVisitorContextImpl;
import org.sonar.squidbridge.api.SourceCode;
import org.sonar.squidbridge.api.SourceFile;
import org.sonar.squidbridge.api.SourceProject;
import org.sonar.squidbridge.indexer.QueryByType;
import org.sonar.squidbridge.metrics.CommentsVisitor;
import org.sonar.squidbridge.metrics.LinesOfCodeVisitor;
import org.sonar.squidbridge.metrics.LinesVisitor;
import com.sonar.sslr.impl.Parser;
public class objectiveCAstScanner {
private objectiveCAstScanner() {
}
/**
* Helper method for testing checks without having to deploy them on a Sonar instance.
*/
public static SourceFile scanSingleFile(File file SquidAstVisitorjectiveCGrammar>... visitors) {
if (!file.isFile()) {
throw new IllegalArgumentException(“File ‘“ + file + “‘ not found.“);
}
AstScannerjectiveCGrammar> scanner = create(new objectiveCConfiguration() visitors);
scanner.scanFile(file);
Collection sources = scanner.getIndex().search(new QueryByType(SourceFile.class));
if (sources.size() != 1) {
throw new IllegalStateException(“Only one SourceFile was expected whereas “ + sources.size() + “ has been returned.“);
}
return (SourceFile) sources.iterator().next();
}
public static AstScannerjectiveCGrammar> create(objectiveCConfiguration conf SquidAstVisitorjectiveCGrammar>... visitors) {
final SquidAstVisitorContextImpljectiveCGrammar> context = new SquidAstVisitorContextImpljectiveCGrammar>(new SourceProject(“objective-C Project“));
final ParserjectiveCGrammar> parser = objectiveCParser.create(conf);
AstScanner.BuilderjectiveCGrammar> builder = AstScanner.jectiveCGrammar> builder(
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-01-29 22:12 sonar-ob
文件 153 2015-01-29 22:12 sonar-ob
文件 4620 2015-01-29 22:12 sonar-ob
文件 547 2015-01-29 22:12 sonar-ob
文件 6421 2015-01-29 22:12 sonar-ob
目录 0 2015-01-29 22:12 sonar-ob
文件 97620 2015-01-29 22:12 sonar-ob
文件 2106 2015-01-29 22:12 sonar-ob
目录 0 2015-01-29 22:12 sonar-ob
目录 0 2015-01-29 22:12 sonar-ob
目录 0 2015-01-29 22:12 sonar-ob
目录 0 2015-01-29 22:12 sonar-ob
目录 0 2015-01-29 22:12 sonar-ob
目录 0 2015-01-29 22:12 sonar-ob
文件 4458 2015-01-29 22:12 sonar-ob
文件 1412 2015-01-29 22:12 sonar-ob
目录 0 2015-01-29 22:12 sonar-ob
文件 1321 2015-01-29 22:12 sonar-ob
文件 4462 2015-01-29 22:12 sonar-ob
文件 1522 2015-01-29 22:12 sonar-ob
文件 2296 2015-01-29 22:12 sonar-ob
文件 1223 2015-01-29 22:12 sonar-ob
目录 0 2015-01-29 22:12 sonar-ob
文件 1246 2015-01-29 22:12 sonar-ob
目录 0 2015-01-29 22:12 sonar-ob
文件 1943 2015-01-29 22:12 sonar-ob
目录 0 2015-01-29 22:12 sonar-ob
文件 1258 2015-01-29 22:12 sonar-ob
文件 1720 2015-01-29 22:12 sonar-ob
目录 0 2015-01-29 22:12 sonar-ob
目录 0 2015-01-29 22:12 sonar-ob
............此处省略72个文件信息
相关资源
- 服务发现系统SkyDNS.zip
- 聊天机器人Lita.zip
- GPS3.0版本
- 如何阅读源代码,开源项目
- wkt转arcgis之geometry第三方组件来自开源
- google word2vec开源项目
- FastDFS的Go客户端fdfs_client.zip
- 几十个开源项目28G设计资料,适用于
- 倒计时屏保.zip
- 七牛云存储同步程序七牛云盘.zip
- 快速可靠网络传输协议KCP.zip
- 开源数据质量解决方案ApacheGriffin.zi
- P2P 自建 DHT 搜索引擎.zip
- jeecg-bootJeecg-Boot 是一款基于代码生成
- gbyk-微信小程序Demo:隔壁有坑UI界面十
- Mac 上轻量 GIF 录屏小工具 - Kap.zip
- 最近很火的分布式数据库 RethinkDB.zi
- selenium-server-2.48.0.zip
- 安卓语法高亮编辑器HighlightTextEditor
- 开源项目-luke-park-exiflign.zip
- VisualStudio扩展EmojiVS.zip
- 3D打印切片引擎CuraEngine.zip
- Google图书工具.zip
- 在屏幕上显示 FPS,CPU 使用率,更好的
- README文件模板-New.zip
评论
共有 条评论