<commit_before>using System.Collections;
using System.Collections.Generic;

namespace Bugsnag
{
  public class StackTrace : IEnumerable<StackTraceLine>
  {
    private readonly System.Diagnostics.StackTrace _originalStackTrace;

    public StackTrace(System.Exception exception) : this(new System.Diagnostics.StackTrace(exception, true))
    {

    }

    public StackTrace(System.Diagnostics.StackTrace stackTrace)
    {
      _originalStackTrace = stackTrace;
    }

    public IEnumerator<StackTraceLine> GetEnumerator()
    {
      var frames = _originalStackTrace.GetFrames();

      if (frames == null)
      {
        yield break;
      }

      foreach (var frame in frames)
      {
        yield return new StackTraceLine(frame);
      }
    }

    IEnumerator IEnumerable.GetEnumerator()
    {
      return GetEnumerator();
    }
  }

  public class StackTraceLine : Dictionary<string, object>
  {
    public StackTraceLine(System.Diagnostics.StackFrame stackFrame)
    {
      var method = stackFrame.GetMethod();

      if (method != null)
      {
        var methodName = method.FriendlyMethodName();

        var lineNumber = stackFrame.FriendlyLineNumber();

        var file = stackFrame.GetFileName();

        this.AddToPayload("file", file);
        this.AddToPayload("lineNumber", lineNumber);
        this.AddToPayload("method", methodName);
        this.AddToPayload("inProject", false);
      }

      // TODO: what should we set these to when the method is null?
    }

    public string FileName
    {
      get
      {
        return (string)this["file"];
      }
      set
      {
        this["file"] = value;
      }
    }
  }
}<commit_msg>Provide unknown value for filename<commit_after>using System.Collections;
using System.Collections.Generic;

namespace Bugsnag
{
  public class StackTrace : IEnumerable<StackTraceLine>
  {
    private readonly System.Diagnostics.StackTrace _originalStackTrace;

    public StackTrace(System.Exception exception) : this(new System.Diagnostics.StackTrace(exception, true))
    {

    }

    public StackTrace(System.Diagnostics.StackTrace stackTrace)
    {
      _originalStackTrace = stackTrace;
    }

    public IEnumerator<StackTraceLine> GetEnumerator()
    {
      var frames = _originalStackTrace.GetFrames();

      if (frames == null)
      {
        yield break;
      }

      foreach (var frame in frames)
      {
        yield return new StackTraceLine(frame);
      }
    }

    IEnumerator IEnumerable.GetEnumerator()
    {
      return GetEnumerator();
    }
  }

  public class StackTraceLine : Dictionary<string, object>
  {
    public StackTraceLine(System.Diagnostics.StackFrame stackFrame)
    {
      var method = stackFrame.GetMethod();

      if (method != null)
      {
        var methodName = method.FriendlyMethodName();

        var lineNumber = stackFrame.FriendlyLineNumber();

        var file = stackFrame.GetFileName() ?? "<unknown>";

        this.AddToPayload("file", file);
        this.AddToPayload("lineNumber", lineNumber);
        this.AddToPayload("method", methodName);
        this.AddToPayload("inProject", false);
      }

      // TODO: what should we set these to when the method is null?
    }

    public string FileName
    {
      get
      {
        return (string)this["file"];
      }
      set
      {
        this["file"] = value;
      }
    }
  }
}
{'fraction_non_alphanumeric': 0.0972139893301719, 'fraction_numerical': 0.0, 'mean_word_length': 2.519290928050052, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5433335', 'n_tokens_mistral': 936, 'n_tokens_neox': 922, 'n_words': 207}