code-analysis

How to best divide big app into modules?

假装没事ソ 提交于 2019-12-20 12:38:21
问题 Building the app I am working on takes a lot of time. Its the biggest one I worked on. I tried to tweak the gradle settings, which is helping, but still the build is quite slow. Since the app was built without modules in mind, its just a whole lot of packages and now I wonder how I could "extract" some of them and put them into separate modules. AFAIK the modules should not have dependencies to the app module, so I wondered if there is a tool or technique which would allow me to analyse code

How to disable pre-commit code analysis for Git-backed projects using IntelliJ IDEA

懵懂的女人 提交于 2019-12-20 11:04:26
问题 I have a project in IntelliJ IDEA, and I'm using Git/GitHub as source control. Each time I try to commit changes, IntelliJ IDEA runs a lengthy code analysis and searches for TODOs. When it finds "problems," it prompts me whether or not I want to review or commit. I don't want the pre-commit code analysis to run, and I don't want IntelliJ IDEA to ask me about the results. I can't seem to find any setting in the regular IntelliJ IDEA project/IDE settings to disable this. How can I disable this?

How to enable Code Analysis in Visual Studio 2010 Professional?

佐手、 提交于 2019-12-20 09:13:07
问题 I can see that we can enable code analysis in Visual Studio Team Systems. But i am using Visual Studio 2010 Professional. Do we have any option to enable code analysis in this version or can we integrate any tools like FxCop and StyleCop with this version for validating the code. I am expecting my code should analysied the moment i build my solution. If somebody aware of this, please share me some solution for this. 回答1: You can integrate FxCop via Commandline in the post-build event of the

Assembly Binding Redirection and Code Analysis

我只是一个虾纸丫 提交于 2019-12-20 08:34:17
问题 I'm using DotNetOpenAuth (which references System.Web.Mvc version 1.0.0.0) in a Mvc 3.0.0.0 project in Visual Studio 2010. I'm using assembly binding redirection as follows:- <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /> <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" /> </dependentAssembly> </assemblyBinding> </runtime> Everything works fine, except code

CA2101 Warning when making extern calls

陌路散爱 提交于 2019-12-19 09:08:22
问题 I'm using the WinPcap libraries and have set up all my native method calls. Upon building I get the CA2101: Specify marshaling for P/Invoke string arguments Code Analysis warning. My extern function is defined like this: [DllImport("wpcap", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] internal static extern int pcap_compile(IntPtr /* pcap_t* */ adaptHandle, IntPtr /*bpf_program **/fp, string /*char * */str, int optimize, uint netmask); If I change the CharSet to

'SuppressMessage' for a whole namespace

Deadly 提交于 2019-12-19 05:03:17
问题 I use underscores for my test methods for a better readability and I want to suppress FxCop errors/warnings for the whole test namespace. How can I achieve this? I played with GlobalSuppressions.cs but nothing worked: [module: System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores", Scope = "namespace", Target = "Company.Product.Tests")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Naming", "CA1707

How to configure StyleCop to suppress warnings on generated code?

被刻印的时光 ゝ 提交于 2019-12-19 02:54:04
问题 Another project, Visual Studio's Code Analysis has this option. But I couldn't find it for StyleCop (AKA Source Analysis). The file I want to ignore is a dbml's .designer.cs code, that includes the // <autogenerated> tag. A blog post tells me that it would be sufficient, but in my case it is not. 回答1: StyleCop: How To Ignore Generated Code Edit: Here is the header I use in generated grammars for ANTLR. This is actually the body of a StringTemplate template, so the two \> entries are actually

Code Analysis - CA1704: Correct the spelling of 'Ps'

此生再无相见时 提交于 2019-12-18 16:53:47
问题 I am getting the following warning from Code Analysis in VS2010 CA1704 : Microsoft.Naming : Correct the spelling of 'Ps' in member name 'MyClass.PsCalculatedAmount' or remove it entirely if it represents any sort of Hungarian notation. Now in my codebase 'Ps' means 'Per Share' and is used heavily, so I would like to allow it as an acceptable word/acronym. I tried adding it to my CustomDictionary.xml under <Words> <Recognized> <Word>ps</Word> ... <Recognized> <Words> and also tried <Acronyms>

Normalization of Strings With String.ToUpperInvariant()

馋奶兔 提交于 2019-12-18 15:30:25
问题 I am currently storing normalized versions of strings in my SQL Server database in lower case. For example, in my Users table, I have a UserName and a LoweredUserName field. Depending on the context, I either use T-SQL's LOWER() function or C#'s String.ToLower() method to generate the lower case version of the user name to fill the LoweredUserName field. According to Microsoft's guidelines and Visual Studio's code analysis rule CA1308, I should be using C#'s String.ToUpperInvariant() instead

Normalization of Strings With String.ToUpperInvariant()

大憨熊 提交于 2019-12-18 15:29:24
问题 I am currently storing normalized versions of strings in my SQL Server database in lower case. For example, in my Users table, I have a UserName and a LoweredUserName field. Depending on the context, I either use T-SQL's LOWER() function or C#'s String.ToLower() method to generate the lower case version of the user name to fill the LoweredUserName field. According to Microsoft's guidelines and Visual Studio's code analysis rule CA1308, I should be using C#'s String.ToUpperInvariant() instead