我知道有很多行计数工具.是否有一些简单的东西不是你使用的其他大包装的一部分?
在unix上寻找一些遗留的c/c ++代码的代码分析工具,专门用于识别依赖关系
我最近开始在Visual Studio中的项目中使用代码分析.我创建了一个自定义规则集,用于包含两个Microsoft定义的规则集的所有项目.我一直在努力将FxCop集成到CI构建过程中,以使未通过所有规则的构建失败.对我来说真正奇怪的是我不能使用我的规则集来定义FxCop扫描代码的规则.我如何使Visual Studio的代码分析规则符合FxCop的规则?
我有兴趣为Code Analysis(Visual Studio 2010及更高版本)创建自定义规则,专门针对XAML.
我读过有关创建自定义规则,甚至有关的FxCop + XAML工具包,但后来现在已被存档,并且不支持的FxCop(即代码分析与工程版)的最新版本.我也看过其他工具,比如NDepend,但它似乎也不支持这个.
我要做的自定义规则的示例: 确保XAML中没有元素将Width属性设置为常量.
关于如何执行此操作的任何想法VS 2012/VS 2013(任何与Visual Studio集成的外部工具也是一种选择)?
xaml unit-testing code-analysis visual-studio-2012 visual-studio-2013
我有一个带有两个钻石的类层次结构,因为必须扩展装饰器模式中的所有类(它们已经虚拟扩展):
namespace _sandbox {
class A {
public:
virtual ~A() {}
virtual void foo()=0;
};
class ADecorator : public virtual A {
private:
A* decoratedA;
public:
ADecorator(A* a) : decoratedA(a) {}
void foo() {return decoratedA->foo();}
};
class AImpl : public virtual A {
public:
void foo() {};
};
class B : public virtual A {
public:
virtual ~B() {}
virtual void bar()=0;
};
class BDecorator : public ADecorator, public B {
private:
B* decoratedB; //Copy of the pointer with a …Run Code Online (Sandbox Code Playgroud) 我正在使用自定义词典(CustomDictionary.xml)进行代码分析,它的工作方式应该如此.但是,我不断收到警告,告诉我XML文件没有正确定义其XSD架构位置:

我CustomDictionary.xsd在我的机器上找到了XSD(),并且我将URI的方案指定为类型file:
file:///C:/Program%20Files%20(x86)/Microsoft%20Visual%20Studio%2012.0/Team%20Tools/Static%20Analysis%20Tools/Schemas/CustomDictionary.xsd
Run Code Online (Sandbox Code Playgroud)
使用此URI,Chrome可以很好地找到XSD文件.那就是说,我如何CustomDictionary.xsd从内部正确引用CustomDictionary.xml?
到目前为止我发现的内容表明以下内容应该有效,但事实并非如此:
<Dictionary
xmlns="http://www.w3schools.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/ file:/.../CustomDictionary.xsd">
Run Code Online (Sandbox Code Playgroud)
(请注意,CustomDictionary.xsd为了清楚起见,我已经截断了路径.)
关于我做错的任何建议?
我正在尝试将Coverity Scan静态分析添加到我的Qt Mac项目中,但我无法使用travis提交构建.
这是我的封面特定travis设置:
addons:
coverity_scan:
project:
name: Phonations/TravisTest
description: Build submitted via Travis CI
notification_email: martin@phonations.com
build_command_prepend: cov-configure --comptype clangcxx --compiler clang++ --template
build_command_prepend: qmake QtTest.pro
build_command: make -j 4
branch_pattern: coverity
Run Code Online (Sandbox Code Playgroud)
这是我通过邮件得到的结果:
Your request for analysis of Phonations/TravisTest is failed.
Analysis status: Failure
Please fix the error and upload the build again.
Error details:
Build uploaded has not been compiled fully. Please fix any compilation error. You may have to run bin/cov-configure as described in the …Run Code Online (Sandbox Code Playgroud) 我想在我的项目中进行代码分析,我正在使用Visual Studio 2013.我可以看到一个Analyze选项卡,它有助于进行代码分析.所以我的问题如下
刚刚在这里找到了帖子,但我不确定是否要使用Fxcop?
http://michaelsync.net/2014/07/19/status-of-fxcop-code-analysis
我将nuget中的Microsoft.CodeAnalysis.CSharp.FxCopAnalyzers安装到一个项目中.
它安装的项目是一个现有的项目,建立在Framework 4.5.1之上.
代码分析已在项目中启用...
...我在Build out put和错误窗口中看到了CA警告,因此我认为规则集是有效的.
但是我似乎无法从分析仪中看出来,我似乎无法找到这个图标在文档中的含义:
右键单击Analyzers节点并选择Open Active Rule Set我可以看到FxCop分析器应该使用的CA规则:
检查DLL的位置,它在nuget文件夹中按预期方式:
我正在开发一个要Windows使用的项目.NET Core 2.2。我将在Linux明年构建和支持它。我正在寻找一种方法来标记错误并破坏构建(如果PlatformNotSupportedException在代码中使用的话)。
我见过.NET API分析器,该分析器仍处于预发布阶段,并且自去年以来未更新。