NDepend Users Voice

Add support for dependency cycles detection for the code using dependency injection

Currently if code is made using dependency injection NDepend fails to detect cyclic dependencies. Sample code:

public interface Interface1
{
void Foo();
};

public interface Interface2
{
void Bar();
};

public class MyClass1 : Interface1
{
private Interface2 _interface2;
public MyClass1(Interface2 interface2)
{
_interface2 = interface2;
_interface2.Bar();
}

void Interface1.Foo()
{
}
}

public class MyClass2 : Interface2
{
private Interface1 _interface1;
public MyClass2(Interface1 interface1)
{
_interface1 = interface1;
_interface1.Foo();
}

public void Bar()
{
}
}

5 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    YahorYahor shared this idea  ·   ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base