Skip to content

Scogun/AutoMapper.Analyzers

Repository files navigation

Analyzers logo

NuGet Version and Downloads count

Table of Contents

  1. Overview
  2. Structure
    1. Currently Available
  3. Code Smells
  4. Installation
    1. NuGet package
    2. VSIX Extention

Overview

Here is AutoMapper Static Analyzers.

The main reason to write this VS Extension and NuGet package is that developers who is not so familiar with AutoMapper sometimes use it not proper way.

Structure

Currently Available

The project already contains:

  1. AutoMapper.Analyzers.Common - common AutoMapper Analyzers
  2. AutoMapper.Analyzers.Common.CodeFixes - common fixes for raised AutoMapper Analyzers diagnostics
  3. AutoMapper.Analyzers.Common.Package - project for building and publishing the NuGet package
  4. AutoMapper.Analyzers.Common.Tests - tests for common AutoMapper Analyzers
  5. AutoMapper.Analyzers.Vsix - project to create VS Extension package

Code Smells

Smells Availability Codes Level Description Fix
Common smells Available AMA0001 Warrning Profile doesn't contain maps In Progress...
AMA0002 Identical names properties are manual mapped Available
AMA0003 Manual checking that src is not null Available for next checking: "??", "== null", "!= null"
AMA0005 Manual flattening of complex model Available
AMA0006 Manual flattening of naming similar complex model Available
AMA0007 Useless try-catch/finally covering of CreateMap calls. Available
In Plans AMA0004 ForMember ignore for all left properties ...

Installation

There are two ways to install analyzers:

NuGet Package

Just add AutoMapper.Contrib.Analyzers package into a project which you would like to control.

VSIX Extention

In case of installation VSIX extention any project will be checking by AutoMapper.Analyzers. So far, there is only one way to install the extension:

  1. Build Vsix project
  2. Find in ...\AutoMapper.Analyzers\package\AutoMapper.Analyzers.Vsix\bin\Release folder AutoMapper.Analyzers.Vsix.vsix file
  3. Run it

In nearest future VSIX extension will be pushed into VSIX repository.