archimetrics's People
Forkers
dietatko jgauffin albertomonteiro stephanvs henrylle matzefriedrich modesto andreyakinshin markheath jeffchen-codingconsultantco rusden220 acidburn0zzz quickorbedead thecodemasterzz wagnerhsu migolm bubdm tinmanjk oaz petermorlionarchimetrics's Issues
How to do member level analysis?
The example you provide shows how to do project analysis. I'm wondering how to the member level analysis using Archimetrics. I noticed some membermetriccalculator functions, but it seems that they are defined as private and cannot be used directly.
Thank you.
Incorrect version in packages.config
There is the following line in ArchiMetrics/tests/ArchiMetrics.CodeReview.Rules.Tests/packages.config
:
<package id="DotNetZip.Reduced" version=" " targetFramework="net452" />
You probably should specify correct version number for DotNetZip.Reduced
(space is illegal in this context).
.NET Core Support
It seems that this doesn't work at the moment due to the current version of the Roslyn packages in the project. There are some tight dependencies to Workspace.Desktop
which are being pulled in that arent part of the .NET Core runtime. However I believe that this should now be pulled out correctly with the latest versions of Roslyn. Is there any chance we can upgrade to use the latest versions.
Related issue: dotnet/roslyn#23011
ClassCoupling always return 0 (zero)
Hi there.
I tested in a simple method and I am getting no ClassCoupling.
The below method should have 2 (two) ClassCoupling, just like Roslyn report:
`void SimpleTest() {
Console.WriteLine("Hello world");
Trace.WriteLine("This method uses Console and Trace");
}`
Am I doing anything wrong?
Thanks,
Missing root element.
Hey team.
This is a great piece of work, and i am finding some real value in it thank you!
I am trying to calculate both the Halstead Metrics as well as Normal code metrics, but everytime i try to to calculate codemetrics on a SyntaxTree i get a "Missing root element" error from an xml parser.
var metricsCalculator = new ArchiMetrics.Analysis.Metrics.SyntaxMetricsCalculator();
var codeCalculator = new CodeMetricsCalculator();
var calculateTasks = projects.SelectMany(a => a.Documents.Where(z => z.SupportsSyntaxTree)).Select(z => z.GetSyntaxRootAsync());
var metrics = (await Task.WhenAll(calculateTasks).ContinueWith(a =>
a.Result.Select(q => new
{
Halstead = metricsCalculator.Calculate(q),
SyntaxTree = q.SyntaxTree,
Project = projects.FirstOrDefault(p =>
q.SyntaxTree.FilePath.Contains(p.AssemblyName)),
})));
foreach (var metric in metrics)
{
try
{
writer.WriteField(metric.SyntaxTree.FilePath.Replace(",", "_"));
var codemetrics = await codeCalculator.Calculate(new SyntaxTree[] { metric.SyntaxTree }); //This throws an error
//var codemetrics = await codeCalculator.Calculate(metric.Project,solution); //this also throws an error
if i only use the halstead metrics then there is no problem and everythings works as expected.
Can't build in VS2015 UP3
I've had problems trying to build the solution in VS2015 Update 3 due to some weird issue with NuGet package restore:
Error occurred while restoring NuGet packages: Cannot cast Newtonsoft.Json.Linq.JArray to Newtonsoft.Json.Linq.JToken.
After many wild guesses, I decided to delete all lines from project.json that contained arrays, (e.g. lists of authors, tags etc) and that seemed to fix the issue. Is this something weird with my setup or has anyone else run into this
Project calculator visibility is internal
Depth of Inheritance doesn't work
Depth of Inheritance doesn't work,
MemberMetric Name property will show whole method
Hello, I would like to use your application to calculate some code metrics for my C# files, but I think I found a problem. MemberMetric.Name
property will show the code for a whole method instead of the method name. I am using the CodeMetricsCalculator
class
Efferent coupling is always 0?
Im running this project on .NET Core projects. I do get LOC, Cyclomatic complexity, maintainability index and abstractness. But efferent coupling is always 0.
I am not loading the projects via the solution file. I am loading the projects per csproj file.
using (var workspace = MSBuildWorkspace.Create())
{
var projectFile = Path.Combine(directory, asset.File);
var project = await workspace.OpenProjectAsync(projectFile);
var result = await metricsCalculator.Calculate(project, workspace.CurrentSolution);
}
Microsoft Build Tools
Should I have to install Microsoft Build Tools 2015 Preview to use ArchiMetrics?
Build issues
Hi @jjrdk, thanks for your work!
Unfortunately I'm not able to use ArchiMetrics. Running your build script is restricted on our companies computers and building the solution in Visual Studio gives me a whole bunch of errors. Also trying to install it as a nuget package leaves me with errors.
All viewable here.
I'm running Visual Studio 2015 Update 3 and MSBuild 14.0.25420.1 .
Would be nice if you could give me any advice.
Cannot update nuget to 1.1.0
It seems to revert due to wanting to install System.Runtime.
Add Class Count
Not part of the standard metrics but I think it would be nice to extend Project Metrics / Namespace Metrics to include number of classes, interfaces etc.
No analyzers found in assembly ArchiMetrics.Analysis
I was trying with RoslynSonarQubePluginGenerator. I downloaded the nuget package and Issued below command:
RoslynSonarQubePluginGenerator.exe /a:archimetrics.analysis:1.1.0
"No analyzers found in assembly ArchiMetrics.Analysis"
New Example
First of all great job.
The current example on the ReadMe.md is out of date CodeMetricsCalculator now requires two parameters. I have downloaded the latest version nuget package of ArchMetrics. I am a bit confused on how to use the API.
My intention is tu pass a SytaxTree or string related to a method and obtain the metrics from it, is this possible?
Make classes public
I'm trying to serialize the results, but since for instance NamespaceMetric is internal it's not possible.
If you want to prevent classes from being created, make the constructor private/internal instead, as that work fine with serializers. But then again, why do you want to hide those classes?
Build script using MSBuild 14
My latest version of MSBuild is v12.0 from VS 13
Add Project to AppVeyor CI
Add ArchiMetrics to a CI server to run all the tests etc. AppVeyor seems like a good choice as it supports running powershell etc. It's also free and badges can be placed onto the project readme.
What do you think?
Not ready for C# 6
I added a single test in ArchiMetrics.Analysis.Tests.Metrics.CodeMetricsCalculatorTests and it failed
[Test]
public async Task CanCalculateMetricsForClassSnippet2()
{
const string Snippet = @"
public class Something {
public string Name => ""Alberto"";
}
";
var tree = CSharpSyntaxTree.ParseText(Snippet);
var task = await _analyzer.Calculate(new[] { tree });
var metrics = task.AsArray();
Assert.IsNotEmpty(metrics);
}
It fails on VisitPropertyDeclaration method in MemberCollector class
Have you plans to support C# 6 features?
Support as Roslyn analyzer.
Is this provide metrics as a warning? it could be written as a Roslyn analyzer.
Which license is for this project?
Hey,
I'm playing around with Roslyn for a college assignment so I was wondering what is the license of this project because we are only supposed to evaluate open source solutions.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.