# Lines of Code Added since the Baseline

Trend Metric Trend Metrics / Code Size

CQLinq source

This trend metric is written in CQLinq, C# LINQ over the NDepend code model. It ships with every new NDepend project: you can read it, adapt it, or use it as a starting point for your own custom rules.

// <TrendMetric Name="# Lines of Code Added since the Baseline" Unit="LoC" />  
from a in Application.Assemblies
let nbLocAdded = !a.IsPresentInBothBuilds()
                 ? a.NbLinesOfCode
                 : (a.NbLinesOfCode != null && a.OlderVersion().NbLinesOfCode != null)
               ? a.NbLinesOfCode - (int)a.OlderVersion().NbLinesOfCode 
                   : 0
select (double?)nbLocAdded


// A value is computed by this Trend Metric query
// only if a Baseline for Comparison is provided.
// See Project Properties > Baseline > Baseline for Comparison

Trend Metrics / Code Size: all 22 items