Esempio n. 1
0
 public void Calculate()
 {
     if (_list.Count < _target || Runtime != null)
     {
         return;
     }
     _list.Sort();
     Runtime = new ListStats <RuntimeInfo>(_list, r => r.Runtime, false);
     CyclomaticComplexity = new ListStats <RuntimeInfo>(_list, r => r.CyclomaticComplexity);
     HalsteadDifficulty   = new ListStats <RuntimeInfo>(_list, r => r.HalsteadDifficulty);
     foreach (var ri in _list)
     {
         _ec.Add(ri.Output);
     }
     OutputEntropy = _ec.GetEntropy();
 }
Esempio n. 2
0
 public void Calculate()
 {
     if (_list.Count < _target || Runtime != null)
     {
         return;
     }
     //_list.Sort();
     Runtime = new ListStats <RuntimeInfo>(_list, r => r.Runtime);
     CyclomaticComplexity = new ListStats <RuntimeInfo>(_list, r => r.CyclomaticComplexity);
     HalsteadDifficulty   = new ListStats <RuntimeInfo>(_list, r => r.HalsteadDifficulty);
     LinesOfCode          = new ListStats <RuntimeInfo>(_list, r => r.LinesOfCode);
     foreach (var ri in _list)
     {
         _ec.Add(ri.Output);
     }
     OutputEntropy       = _ec.GetEntropy();
     SyntaxErrorValidity = _list.Count(ri => ri.MatchSyntaxError) / (double)_list.Count;
     SyntaxErrorRuntime  = _list.Average(ri => ri.SyntaxErrorRuntime);
 }