--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/521936f1-7fcc-4c39-9b8f-b73f61dd8526%40googlegroups.com.
public class Class1 : ISilly
{
public void AddStuff(int id, List<int> list)
{
list.Add(id);
}
public async Task AddStuffAsync(int id, List<int> list)
{
await Task.Run(() => { list.Add(id);});
}
public string GetStuff()
{
return "a property is better";
}
public async Task<string> GetStuffAsync()
{
var result = GetStuff();
return await Task.FromResult(result);
}
public string GetStuffNotInInterface()
{
return "a property is better";
}
}
public interface ISilly
{
void AddStuff(int id, List<int> list);
Task AddStuffAsync(int id, List<int> list);
string GetStuff();
Task<string> GetStuffAsync();
}
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="c:\program files (x86)\microsoft visual studio 14.0\team tools\static analysis tools\fxcop\Xml\CodeAnalysisReport.xsl"?>
<FxCopReport Version="14.0">
<Targets>
<Target Name="D:\sonartest\ExampleLibrary\ExampleLibrary\bin\Debug\ExampleLibrary.dll">
<Modules>
<Module Name="examplelibrary.dll">
<Namespaces>
<Namespace Name="ExampleLibrary">
<Types>
<Type Name="Class1" Kind="Class" Accessibility="Public" ExternallyVisible="True">
<Members>
<Member Name="#AddStuff(System.Int32,System.Collections.Generic.List`1<System.Int32>)" Kind="Method" Static="False" Accessibility="Public" ExternallyVisible="True">
<Messages>
<Message TypeName="DoNotExposeGenericLists" Category="Microsoft.Design" CheckId="CA1002" Status="Active" Created="2016-08-10 08:39:19Z" FixCategory="Breaking">
<Issue Certainty="95" Level="Error" Path="D:\sonartest\ExampleLibrary\ExampleLibrary" File="Class1.cs" Line="12">Change 'List<int>' in 'Class1.AddStuff(int, List<int>)' to use Collection<T>, ReadOnlyCollection<T> or KeyedCollection<K,V></Issue>
</Message>
</Messages>
</Member>
<Member Name="#AddStuffAsync(System.Int32,System.Collections.Generic.List`1<System.Int32>)" Kind="Method" Static="False" Accessibility="Public" ExternallyVisible="True">
<Messages>
<Message TypeName="DoNotExposeGenericLists" Category="Microsoft.Design" CheckId="CA1002" Status="Active" Created="2016-08-10 08:39:19Z" FixCategory="Breaking">
<Issue Certainty="95" Level="Error">Change 'List<int>' in 'Class1.AddStuffAsync(int, List<int>)' to use Collection<T>, ReadOnlyCollection<T> or KeyedCollection<K,V></Issue>
</Message>
</Messages>
</Member>
<Member Name="#GetStuffNotInInterface()" Kind="Method" Static="False" Accessibility="Public" ExternallyVisible="True">
<Messages>
<Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Status="Active" Created="2016-08-10 08:39:19Z" FixCategory="Breaking">
<Issue Certainty="50" Level="Warning" Path="D:\sonartest\ExampleLibrary\ExampleLibrary" File="Class1.cs" Line="35">Change 'Class1.GetStuffNotInInterface()' to a property if appropriate.</Issue>
</Message>
</Messages>
</Member>
</Members>
</Type>
<Type Name="ISilly" Kind="Interface" Accessibility="Public" ExternallyVisible="True">
<Members>
<Member Name="#AddStuff(System.Int32,System.Collections.Generic.List`1<System.Int32>)" Kind="Method" Static="False" Accessibility="Public" ExternallyVisible="True">
<Messages>
<Message TypeName="DoNotExposeGenericLists" Category="Microsoft.Design" CheckId="CA1002" Status="Active" Created="2016-08-10 08:39:19Z" FixCategory="Breaking">
<Issue Certainty="95" Level="Error">Change 'List<int>' in 'ISilly.AddStuff(int, List<int>)' to use Collection<T>, ReadOnlyCollection<T> or KeyedCollection<K,V></Issue>
</Message>
</Messages>
</Member>
<Member Name="#AddStuffAsync(System.Int32,System.Collections.Generic.List`1<System.Int32>)" Kind="Method" Static="False" Accessibility="Public" ExternallyVisible="True">
<Messages>
<Message TypeName="DoNotExposeGenericLists" Category="Microsoft.Design" CheckId="CA1002" Status="Active" Created="2016-08-10 08:39:19Z" FixCategory="Breaking">
<Issue Certainty="95" Level="Error">Change 'List<int>' in 'ISilly.AddStuffAsync(int, List<int>)' to use Collection<T>, ReadOnlyCollection<T> or KeyedCollection<K,V></Issue>
</Message>
</Messages>
</Member>
<Member Name="#GetStuff()" Kind="Method" Static="False" Accessibility="Public" ExternallyVisible="True">
<Messages>
<Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Status="Active" Created="2016-08-10 08:39:19Z" FixCategory="Breaking">
<Issue Certainty="50" Level="Warning">Change 'ISilly.GetStuff()' to a property if appropriate.</Issue>
</Message>
</Messages>
</Member>
<Member Name="#GetStuffAsync()" Kind="Method" Static="False" Accessibility="Public" ExternallyVisible="True">
<Messages>
<Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Status="Active" Created="2016-08-10 08:39:19Z" FixCategory="Breaking">
<Issue Certainty="50" Level="Warning">Change 'ISilly.GetStuffAsync()' to a property if appropriate.</Issue>
</Message>
</Messages>
</Member>
</Members>
</Type>
</Types>
</Namespace>
</Namespaces>
</Module>
</Modules>
</Target>
</Targets>
<Rules>
<Rule TypeName="DoNotExposeGenericLists" Category="Microsoft.Design" CheckId="CA1002">
<Name>Do not expose generic lists</Name>
<Description>Do not expose List<T> in object models. Use Collection<T>, ReadOnlyCollection<T> or KeyedCollection<K,V> instead. List<T> is meant to be used from implementation, not in object model API. List<T> is optimized for performance at the cost of long term versioning. For example, if you return List<T> to the client code, you will not ever be able to receive notifications when client code modifies the collection.</Description>
<Resolution Name="Default">Change {0} in {1} to use Collection<T>, ReadOnlyCollection<T> or KeyedCollection<K,V></Resolution>
<Owner />
<Url>http://msdn.microsoft.com/library/ms182142.aspx</Url>
<Email>[none]</Email>
<MessageLevel Certainty="95">Error</MessageLevel>
<File Name="designrules.dll" Version="14.0.0.0" />
</Rule>
<Rule TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024">
<Name>Use properties where appropriate</Name>
<Description>Properties should be used instead of Get/Set methods in most situations. Methods are preferable to properties in the following situations: the operation is a conversion, is expensive or has an observable side-effect; the order of execution is important; calling the member twice in succession creates different results; a member is static but returns a mutable value; or the member returns an array.</Description>
<Resolution Name="Default">Change {0} to a property if appropriate.</Resolution>
<Owner />
<Url>http://msdn.microsoft.com/library/ms182181.aspx</Url>
<Email>[none]</Email>
<MessageLevel Certainty="75">Warning</MessageLevel>
<File Name="designrules.dll" Version="14.0.0.0" />
</Rule>
</Rules>
<Localized>
<String Key="Category">Category</String>
<String Key="Certainty">Certainty</String>
<String Key="CollapseAll">Collapse All</String>
<String Key="CheckId">Check Id</String>
<String Key="Error">Error</String>
<String Key="Errors">error(s)</String>
<String Key="ExpandAll">Expand All</String>
<String Key="Help">Help</String>
<String Key="Line">Line</String>
<String Key="Messages">message(s)</String>
<String Key="LocationNotStoredInPdb">[Location not stored in Pdb]</String>
<String Key="Project">Project</String>
<String Key="Resolution">Resolution</String>
<String Key="Rule">Rule</String>
<String Key="RuleFile">Rule File</String>
<String Key="RuleDescription">Rule Description</String>
<String Key="Source">Source</String>
<String Key="Status">Status</String>
<String Key="Target">Target</String>
<String Key="Warning">Warning</String>
<String Key="Warnings">warning(s)</String>
<String Key="ReportTitle">Code Analysis Report</String>
</Localized>
</FxCopReport>
--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/c9ace3b4-0a9d-41dc-bb5e-7dcd052dea7b%40googlegroups.com.
Hello,I think ignoring/hiding them would lead to confusion. When you run the analysis inside the IDE, you'd get N issues, while in SonarQube would get M. How come M != N? I think it's better to show all issues on SonarQube side.We discussed this problem internally, how the SQ UI should handle these issues. And concluded that issues without location are a corner case (as you said our rules have locations, and most of the FxCop ones too), so we are not going to introduce any special UI for these issues.Note, that you will only have to deal with these issues once. You confirm/reject/.. them, and then they won't show up again. So if you're tracking the introduced leak, then you'd deal with a bunch of these issues once when you introduce SQ, and then when you introduce some code that produces these kind of issues, but chances are in these incremental steps there are only a couple issues each time. Another option is to disable the noisy FxCop rules altogether. In this case you'd have to decide for yourself if they produce enough value to deal with the above inconvenience or not.Tamas
On 10 August 2016 at 11:48, <joni.pu...@gmail.com> wrote:
OK probably found the root cause for the behavior of not displaying the file/line:The point 3 and the note. There is no way to get that information via fxcop even with the pdb info :(So this being the case could there be an option to ignore/hide issues that don't have link to source file from Sonar web UI?
--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
Hello,I think ignoring/hiding them would lead to confusion. When you run the analysis inside the IDE, you'd get N issues, while in SonarQube would get M. How come M != N? I think it's better to show all issues on SonarQube side.We discussed this problem internally, how the SQ UI should handle these issues. And concluded that issues without location are a corner case (as you said our rules have locations, and most of the FxCop ones too), so we are not going to introduce any special UI for these issues.Note, that you will only have to deal with these issues once. You confirm/reject/.. them, and then they won't show up again. So if you're tracking the introduced leak, then you'd deal with a bunch of these issues once when you introduce SQ, and then when you introduce some code that produces these kind of issues, but chances are in these incremental steps there are only a couple issues each time. Another option is to disable the noisy FxCop rules altogether. In this case you'd have to decide for yourself if they produce enough value to deal with the above inconvenience or not.Tamas
On 10 August 2016 at 11:48, <joni.pu...@gmail.com> wrote:
OK probably found the root cause for the behavior of not displaying the file/line:The point 3 and the note. There is no way to get that information via fxcop even with the pdb info :(So this being the case could there be an option to ignore/hide issues that don't have link to source file from Sonar web UI?
--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.