AdminPatrick Smacchia (Senior Software Engineer, NDepend)

My feedback

  1. 1 vote
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    6 comments  ·  NDepend User Voice » Code Rule and Query  ·  Flag idea as inappropriate…  ·  Admin →
    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 

    @rumba we downloaded the IDesign practices & principles documentation. You want to enforce dependencies between layers aren't you?

    You can reuse material from this default rule for that:
    https://www.ndepend.com/default-rules/NDepend-Rules-Explorer.html?ruleid=ND1404#

    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 

    Can you achieve that by modifying this default rule?
    https://www.ndepend.com/default-rules/NDepend-Rules-Explorer.html?ruleid=ND1404#!

    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 

    Is there a page that enumerate all these principles?

  2. 127 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    11 comments  ·  NDepend User Voice » Code Rule and Query  ·  Flag idea as inappropriate…  ·  Admin →
    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 

    >The question is, shall you and when will you provide this?

    Yes this is high on our TODO list, hopefully in 2020

    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 

    Thanks Thad, we work hard to deliver value several times a year,
    https://www.ndepend.com/whatsnew

    Prioritizing new features is not an easy task and your feedback matters to us, thanks

    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 

    We started investigating about supporting attribute value
    Your feedbacks here or at support at ndepend dot com will be welcome.

    --

    First we have a restriction: For example from attribute
    [ComVisible(true)]
    we won't be able to bind the value "true" with the property "ComVisibleAttribute.Value"
    because the info to bind ctor "visibility" parameter to the property "ComVisibleAttribute.Value"
    is enclosed in the IL of the attribute class that we don't plan to read at the moment
    because at this point in analysis, we only have access to the attribute class reference,
    not access to the attribute class definition (with th IL)

    --

    However this example would work fine (no matter if Level is a property or a field)
    [ComponentCriticality (Level= CriticalityLevel.High)]
    coz we know about property/field name Level
    and it could be queried this way:

    // <Name>Classes with a Criticality High should be 100% covered by tests</Name>
    from t in Application.Types
    where t.GetAttributeTag("Namespace.ComponentCriticalityAttribute") // Returns a IAttributeTag or null
    .IfNotNullGetPropertyNamed("Level") // Returns a IAttributeTagProperty or null
    .IfNotNullGetValueAsEnumValue() // Returns a IField (for the enum value) or null
    .IfNotNullGetSimpleName() == "High"
    && t.PercentageCoverage < 100
    select new { t, t.PercentageCoverage }

    or this way

    // <Name>Classes with a Criticality High should be 100% covered by tests</Name>
    from t in Application.Types
    where t.GetAttributeTag("Namespace.ComponentCriticalityAttribute") // Returns a IAttributeTag or null
    .IsNotNullAnd(attrTag => attrTag.GetPropertyNamed("Level") // attrTag is a IAttributeTag
    .IsNotNullAnd(prop => prop.ValueAsEnumValue // prop is a IAttributeTagProperty
    .IsNotNullAnd(val => val.SimpleName == "High"))) // val is a IField
    && t.PercentageCoverage < 100
    select new { t, t.PercentageCoverage }

    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 

    This feature is demanded, we will definitely implement it, it is just a matter of time, hopefully next year

  3. 83 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    16 comments  ·  NDepend User Voice » Code Model  ·  Flag idea as inappropriate…  ·  Admin →
    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 

    It looks like NDepend supporting DI won't make it. We explain the reason for our decisions in this post:
    https://blog.ndepend.com/static-analysis-and-dependency-injection/

    If you don't agree please let us know and comment. We are looking for productive discussions.
    Thanks

    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 

    Hi Anton

    >That is why I would love this feature, it will allow to understand real dependencies.

    "Real dependencies" at runtime indeed,

    >And sometime foundation level depends on project (in DI).

    But why would this be a problem? I see here proper application of DIP Dependency Inversion Principle
    - At design time Fundation depends on interfaces implemented by Project
    - At design time of course Project depends on these interfaces since it contains classes that implement them
    - At design time Fundation doesn't depend on Project
    Why would it be a problem if at runtime Fundation depends on Project? (thanks to DI)

    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 

    We are planning to implement this within the next months. To clarify what we'd like to do suppose we have DI code like

    container.RegisterType<ITab, HomeTab>();
    container.RegisterType<ITab, GamesTab>();

    The idea will be that **all** usage of ITab or **all** call to ITag.Fct() will be seen also as an usage of HomeTab and GamesTab and a call to HomeTab.Fct()and GamesTab.Fct().

    This will provoke some dependency cycles also an NDepend project setting will be proposed to disable this binding.

    We'll investigate those frameworks: Autofac, UnityContainer, NInject, StructureMap, MEF, SimpleInjector, Castle.Windsor, LightInject, Prism, Spring.net
    See below some sample syntax that we plan to support.

    We plan also the possibility to provide a .csv files with interface,class dependencies, for those using a custom DI fx. Thus for those using DI through custom XML file they'll need to transform the XML into the .csv format to use this feature.

    Your feedback will be welcome

    Some sample syntax that we plan to support:

    Autofac
    builder.RegisterType<EmailService>().As<IMailService>

    IUnityContainer
    container.RegisterType<ICar, BMW>();

    NInject
    Bind<IMailSender>().To<MockMailSender>();

    SimpleInjector
    container.Register<IOrderRepository, SqlOrderRepository>();

    Castle.Windsor
    container.Register(Component.For<ICompositionRoot>().ImplementedBy<CompositionRoot>());

    LightInject
    container.Register<IFoo, Foo>();

    Prism
    this.container.RegisterType<IOrdersRepository, OrdersRepository>(new ContainerControlledLifetimeManager());

    StructureMap
    ObjectFactory.Initialize(x => { x.For<IStuff>().Use<RealStuff>(); });

    MEF
    public interface ITab { void Fct() }
    [Export(typeof(ITab))]
    public class HomeTab : ITab { public void Fct() {} }
    [Export(typeof(ITab))]
    public class GamesTab : ITab { public void Fct() {}}

    AdminPatrick Smacchia (Senior Software Engineer, NDepend) shared this idea  · 
  4. 3 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    2 comments  ·  NDepend User Voice » Dependency Graph  ·  Flag idea as inappropriate…  ·  Admin →
    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 

    Have you seen critical Rules? They can fail the build with the Quality Gate associated with
    https://www.ndepend.com/default-rules/NDepend-Rules-Explorer.html?ruleid=CriticalRulesViolated#!

    This can fail the build on Build Machine and Azure DevOps / TFS, but not in Visual Studio.
    https://www.ndepend.com/docs/quality-gates#BuildFailure

  5. 38 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    3 comments  ·  NDepend User Voice » Build Process Integration  ·  Flag idea as inappropriate…  ·  Admin →
    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 

    KiranNandedkar isn't the tutorial helping?https://www.ndepend.com/docs/appveyor-integration-ndepend let us know if anything is unclear there

    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 

    Find a tutorial about integrating NDepend analysis into your AppVeyor build process here: https://www.ndepend.com/docs/appveyor-integration-ndepend

  6. 99 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    3 comments  ·  NDepend User Voice  ·  Flag idea as inappropriate…  ·  Admin →
    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 

    Until we provide a first-class Atlassian Bamboo plugin, anyone interested in integrating NDepend into Bamboo can read this great tutorial written by Nordès Ménard-Lamarre https://www.ndepend.com/docs/atlassian-bamboo-integration-ndepend

  7. 70 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    7 comments  ·  NDepend User Voice » Code Model  ·  Flag idea as inappropriate…  ·  Admin →
    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 

    >VB.net code # Lines of Comment calculation seems wrong. Always shows 0

    Indeed because VB.NET is not 100% supported yet, more info here
    https://www.ndepend.com/docs/ndepend-analysis-inputs-explanation

    We hope to support VB.NET 100% within the next months

    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 

    In VB.NET "Open my declaration in Source Code" is available for non-abstract method so far. And for sure, when VB.NET will be parsed, this will be supported for all code elements.

    AdminPatrick Smacchia (Senior Software Engineer, NDepend) shared this idea  · 
  8. 125 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    3 comments  ·  NDepend User Voice » Code Coverage  ·  Flag idea as inappropriate…  ·  Admin →
    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 

    not yet unfortunately, hopefully in 2018

  9. 36 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    3 comments  ·  NDepend User Voice » NDepend Project  ·  Flag idea as inappropriate…  ·  Admin →
    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 

    For v2017.3 we are focusing on analyzing NuGet packages referenced by your application assemblies (i.e v2017.3 will resolve third-party assemblies in NuGet packages)

    But this is definitely important to analyze application assemblies of one or several NuGet packages.

    For now you can still use the feature -Analyze assemblies in folder (***recursive***)- and point out to C:\Users\[users]\.nuget\packages or wherever lies your NuGet packages unzipped
    and then filter assemblies to analyze by names

    You'll then see how assemblies of your packages relate.

    But you'll miss

    1) filter by package name that can be more convenient than filter by assemblies (in NuGet pkg) names

    2) filter by moniker (netstandard1.X...) (a moniker will be chosen randomly, but you can change the dir referenced by the project property later in Project Properties > Code to Analyze > Folders)

    3) filter by version to analyze (when several assemblies with the same name are found in the folders referenced by the NDepend project, NDepend will analyze assemblies with highest version, so as in 2) this can be controlled by changing folders referenced in Project Properties > Code to Analyze > Folders)

  10. 15 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    2 comments  ·  NDepend User Voice » Code Rule and Query  ·  Flag idea as inappropriate…  ·  Admin →
    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 

    Not anytime soon, sorry

  11. 58 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    5 comments  ·  NDepend User Voice » Code Rule and Query  ·  Flag idea as inappropriate…  ·  Admin →
    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 

    No not yet sorry

    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 

    Being able to search for a concrete usage of a generic type

    Basically you have a gneric method (or type) like DoIt<T>(T). currently it is possible to search for the usage of this method.
    it would be really usefull to also be able to search for DoIt<String>(String), a concrete instantiation of the generic method.

    This information is currently available in the IL code.

  12. 44 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    4 comments  ·  NDepend User Voice » Code Rule and Query  ·  Flag idea as inappropriate…  ·  Admin →
    An error occurred while saving the comment

    Let's repor this 5May2015 comment that was on this duplicate question https://ndepend.uservoice.com/forums/226344-ndepend-user-voice/suggestions/9752604-let-queries-pull-data-from-other-queries

    ---

    This would be very useful to define meta types (E.g. TestFixtures, Test Assemblies, Domain Entities, MessageHandlers, DTOs etc.).
    There is also the request for "Allow custom definitions similar to JustMyCode" which is the same in my opinion.

    This should be implemented easily, as it is possible to do this today with a little hack:
    /////// Rule that will be reused, defining test code ////////
    // <Name>TestFixtures</Name>
    warnif count > 0 // <= this is needed :(
    from t in JustMyCode.Types

    where t.HasAttribute("NUnit.Framework.TestFixtureAttribute".MatchType())

    select t
    ///////////////
    /////// Example rule that uses the other rule ////////
    // <Name>Testfixtures should end with "Tests"</Name>
    //let testFixtures = (from i in Issues where i.Rule.Name == "TestFixtures" select i.CodeElement).Cast<IType>()
    let TestFixtures = Rules.First(r => r.Name == "TestFixtures").Issues().Select(i => i.CodeElement).OfType<IType>()
    from t in TestFixtures

    where !t.IsAbstract && !t.Name.EndsWith("Tests")

    select t
    ///////////////
    /////// Example rule for exclusion ////////
    // <Name>Example of exclusion</Name>
    let TestFixtures = Rules.First(r => r.Name == "TestFixtures").Issues().Select(i => i.CodeElement).OfType<IType>()

    from t in JustMyCode.Types

    where !t.IsAbstract && t.TypesUsingMe.Count() <= 0 && !TestFixtures.Contains(t)

    select t
    ///////////////

    Also defining custom extension methods may be even more usefull, as it fits the exclusion rule better.

  13. 134 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    5 comments  ·  NDepend User Voice » Build Process Integration  ·  Flag idea as inappropriate…  ·  Admin →
    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 

    Until we provide a first-class Jenkins plugin, anyone interested in integrating NDepend into Jenkins can read this great tutorial written by Richard Moss http://www.ndepend.com/docs/jenkins-integration-ndepend

    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 

    Thanks Thomas, sure through NDepend.Console.exe NDepend can hopefully be invoked by any CI tool. What we means by a plugin, is that maybe you could collect code metrics and code rules execution result and populate the Jenkins DB with these metrics values. This could be achieved through a OSS plugin based on NDepend.API.

    AdminPatrick Smacchia (Senior Software Engineer, NDepend) shared this idea  · 
  14. 16 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  NDepend User Voice  ·  Flag idea as inappropriate…  ·  Admin →
    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 

    An idea would be to provide some OSS code based on both NDepend.API and Roslyn that would automate Roslyn from NDepend rule results.

  15. 4 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  NDepend User Voice » Dependency Graph  ·  Flag idea as inappropriate…  ·  Admin →
    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 
  16. 5 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  NDepend User Voice  ·  Flag idea as inappropriate…  ·  Admin →
    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 

    Thanks Rob for the suggestions, so far stackoverflow has been a good way to share knowledge and answer specific question, but we take note of the need for an open user forum thanks

  17. 2 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  NDepend User Voice » New Interactive Panel  ·  Flag idea as inappropriate…  ·  Admin →
    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 

    This sounds a bit too specific, would a custom program based on NDepend.API be more suited for this?
    http://www.ndepend.com/api/webframe.html?NDepend.API_gettingstarted.html

    Also have your read these related documents?
    http://www.ndepend.com/docs/white-books

  18. 3 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  NDepend User Voice » Visual Studio Integration  ·  Flag idea as inappropriate…  ·  Admin →
    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 

    Have you tried, source editor > right click code element > NDepend > Center Me in Metric View ?

  19. 70 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    3 comments  ·  NDepend User Voice » Code Model  ·  Flag idea as inappropriate…  ·  Admin →
    An error occurred while saving the comment
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) commented  · 

    When this will be implemented, IEvent will have to be implemented too.

    AdminPatrick Smacchia (Senior Software Engineer, NDepend) shared this idea  · 
  20. 41 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    2 comments  ·  NDepend User Voice » Code Model  ·  Flag idea as inappropriate…  ·  Admin →
    AdminPatrick Smacchia (Senior Software Engineer, NDepend) shared this idea  · 
← Previous 1

Feedback and Knowledge Base