SubMain - CodeIt.Right The First Time!

/Community

Support Community for SubMain Products
 Home Products Services Download Purchase Support
in Search
 
Home Forums Blogs Tutorials/CIR Tutorials/GD Downloads
Welcome to SubMain Community Sign in | Join | Help

Problem With Metrics

Last post 07-11-2011, 1:02 PM by csuchanec. 6 replies.
Sort Posts: Previous Next
  •  04-19-2010, 1:45 PM 1211

    Problem With Metrics

    I'm having a problem with the code Metrics.  When i run the metrics on one particular assembly in one solution I get valid numbers.  However, in any other solution I run it from I get that there are no instructions and not Executable LoC and therefore all my numbers are thrown off.  Is there a reason this would be happening?  Is there a way i can correct this?
  •  04-23-2010, 7:57 AM 1214 in reply to 1211

    Re: Problem With Metrics

    Craig,

    Is there any way for us to reproduce this? Are by chance running this on an open source project that we could test against?

    Thanks!

     


    Thank you,
    Serge Baranovsky
    http://submain.com - .NET Developer Tools  |  Microsoft MVP  |  ASP Insider
    » » CodeIt.Right Will Fix Your Code!™ - http://submain.com/codeit.right
    » » C#/VB .NET Coding Guidelines - FREE 100+ page ebook (PDF) http://submain.com/guidelines
  •  07-05-2011, 11:30 AM 1782 in reply to 1214

    Re: Problem With Metrics

    I have no way of reproducing this with an open source project.  I just got the error with another project though.  This project was not causing a problem until there was some update within the last month.  It seems completely illogical. 

  •  07-05-2011, 12:52 PM 1783 in reply to 1782

    Re: Problem With Metrics

    I did some digging into the logs generated by running the tool and I found the followin exception was happening.  Maybe this will help in tracking down the error.

     

    System.NullReferenceException: Object reference not set to an instance of an object.

    at ExactMagic.SharedServices.Services.Solution.AttributeSolutionHierarchyItem..ctor(IAddinContext context, CodeElementSolutionHierarchyItem parent, ProjectHierarchyItem container, Stack`1 namesScope, Stack`1 nameamespaceDeclarations, INode sourceElement)

    at ExactMagic.SharedServices.Services.Solution.NamespaceScopedSolutionierarchyItem..ctor(IAddinContext context, CodeElementSolutionHierarchyItem parent, ProjectHierarchyItem container, Stack`1 namesScope, Stack`1 nameamespaceDeclarations, INode sourceElement)

    at ExactMagic.SharedServices.Services.Solution.TypeSolutionHierarchyItem..ctor(IAddinContext context, CodeElementSolutionHierarchyItem parent, ProjectHierarchyItem container, Stack`1 namesScope, Stack`1 nameamespaceDeclarations, INode sourceElement)

    at ExactMagic.SharedServices.Services.Solution.ClassSolutionHierarchyItem..ctor(IAddinContext context, CodeElementSolutionHierarchyItem parent, ProjectHierarchyItem container, Stack`1 namesScope, Stack`1 nameamespaceDeclarations, INode sourceElement)

    at ExactMagic.SharedServices.Services.Solution.ProjectHierarchyItemParseVisitor.VisitTypeDeclaration(TypeDeclaration typeDeclaration, Object data)

    at ICSharpCode.NRefactory.Ast.TypeDeclarationAcceptVisitor(IAstVisitor visitor, Object data)

    at ICSharpCode.NRefactory.Ast.TypeDeclarationAcceptChildren(IAstVisitor visitor, Object data)

    at ExactMagi.SharedServices.Services.Solution.ProjectHierarchyItemParseVisitor.VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, Object data)

    at ICSharpCode.NRefactory.Ast.NamespaceDeclaration.AcceptVisitor(IAstVisitor visitor, Object data)

    at ICSharpCode.NRefactory.Ast.AbstractNode.AcceptChildren(IAstVisitor visitor, Object data)

    at ICShartpCode.NRefactory.Visitors.AbstractAstVisitor.VisitCompilationUnit(CompilationUnit compilationUnit, Object data)

    at ICSharpCode.NRefactory.Ast.CompilationUnit.AcceptVisitor(IAstVisitor visitor, Object data)

    at ExactMagic.SharedServices.Services.Solution.Project HierarchyItem.<get_BuildChildren>d_1a.MoveNext()

     

    This then repeats over and over again in the log.

     

  •  07-05-2011, 1:47 PM 1784 in reply to 1783

    Re: Problem With Metrics

    I also found another error in the log files that I am also getting.  This one I think is more likely the cause.

     

    System.IO.FileNotFoundExecption: Could not resolve: (an assembly in my project that works fine otherwise -- note its not the assembly the problem is for but one that depends upon the assembly that has the problem)

    at Mono.Cecil.BaseAssemblyResolver, Resolve(AseemblyNameReference name)

    at Modno.Cecil.DefaultAssemblyResolver.Resolve(AssemblyNameReference name)

    at ExactMagic.Analysis.AnalysisContext.SpecificLocationAssemblyResolver.Resolve(AssemblyNameReference name)

    at ExactMagic.Analysis.AnalysisContext.LoadAssembly(UtilityHandler`1 callback, AssemblyDefinition assembly, Boolean loadFUlly, FileInfo[] fromFiles)

     

    Then followed by a series of

    QuickGraph.VertexNotFoundExecption: e.Target

    at QuickGraph.GraphContracts.AssumeInVertexSet[TVertex](IVertexSet`1 g, TVertex v, String parameterName)

    at QuickGraph.GraphContracts.AssumeInVertexSet[TVertex, TEdge](IVertexAndEdgeSEt`2 g, TEdge e, String parameterName)

    at QuickGraph.AjacencyGraph`2.AddEdge(TEdge e)

    at ExactMagic.Analysis.DependencyGraph.RelateMethodOverrides(SolutionDefinition solution)

  •  07-06-2011, 9:19 AM 1786 in reply to 1784

    Re: Problem With Metrics

    Hi Craig,

    Do you use StudioTools with VS2010?

     


    Thank you,
    Serge Baranovsky
    http://submain.com - .NET Developer Tools  |  Microsoft MVP  |  ASP Insider
    » » CodeIt.Right Will Fix Your Code!™ - http://submain.com/codeit.right
    » » C#/VB .NET Coding Guidelines - FREE 100+ page ebook (PDF) http://submain.com/guidelines
  •  07-11-2011, 1:02 PM 1789 in reply to 1786

    Re: Problem With Metrics

    This problem was occuring with Visual Studio 2008.  We are in the process of updating to .Net 4, but I haven't yet attempted to run the metrics using VS2010.
View as RSS news feed in XML
 
     
 
Home |  Products |  Services |  Download |  Purchase |  Support |  Community |  About Us |