Code Monkey home page Code Monkey logo

changeanalyzer's Introduction

Source Code Change Analyzer

This utility will scan the changes between a point in the past and the current state of a version controlled .NET solution in order to highlight important changes. To accompilish this, we use the version control functionality to fetch the differences between the two points in time, and have the Microsoft Compiler Platform (roslyn) open the solution, enumerate its projects, and retrieve methods that have changed.

Implementation Information

The solution is divided in two major parts: the ChangeAnalysis project, which contains the main analyzer logic (the Analyzer class); and the Analyze project under the Git folder. The former project exposes the ISourceControlProvider interface which should be implemented by clients that wish to provide the service for a particular source control provider:

    public interface ISourceControlProvider<T>
    {
        IEnumerable<Change> GetChanges(T since, string extensionFilter);
        DateTime GetTimestamp(T when);
    }

The latter project, which is the command line user interface to the analyzer, has implemented this interface for the Git source control system.

Usage

From the command line, you can run the utility as follows:

analyze.exe -s <solution file path> -c <commit object id> [-w <working directory>] [-m] [-o <output file>]

The options are:

  • -s <solution file path> (required): the path to your project's sln file;
  • -c <commit object id> (required): the commit identifier to be diff'ed against HEAD;
  • -w <working directory> (optional): the root of your repository. Assumed to be the current directory if mising. Relative paths are OK;
  • -m (optional): if present, changed methods are listed separately instead of in the context of their referencing project;
  • -o <output file> (optional): path to an output file to pretty print the output (in html).

Running the command results in a report of:

  1. Changed stylesheets (css, sass or less);
  2. Changed scripts (js);
  3. (if the -m flag is specified) Changed methods;
  4. Projects that reference the changed methods and therefore need to be rebuilt - the referenced methods are grouped within the projects.

TODO

Handle the case of methods that have been removed. Currently, removed methods are ignored in the comparison.

changeanalyzer's People

Contributors

gtryf avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.