<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mono.Cecil;
using Mono.Collections.Generic;

namespace AutoTest.TestRunners.Shared.AssemblyAnalysis
{
    public class SimpleTypeLocator
    {
        private string _assembly;
        private string _type;

        public SimpleTypeLocator(string assembly, string type)
        {
            _assembly = assembly;
            _type = type;
        }

        public SimpleType Locate()
        {
            var asm = AssemblyDefinition.ReadAssembly(_assembly);
            foreach (var module in asm.Modules)
            {
                var result = locateSimpleType(module.Types);
                if (result != null)
                    return result;
            }
            return null;
        }

        public SimpleType LocateParent()
        {
            var end = _type.LastIndexOf('.');
            if (end == -1)
                return null;
            _type = _type.Substring(0, end);
            return Locate();<commit_msg>Fixed a file not found bug in the testrunner shared code<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mono.Cecil;
using Mono.Collections.Generic;
using System.IO;

namespace AutoTest.TestRunners.Shared.AssemblyAnalysis
{
    public class SimpleTypeLocator
    {
        private string _assembly;
        private string _type;

        public SimpleTypeLocator(string assembly, string type)
        {
            _assembly = assembly;
            _type = type;
        }

        public SimpleType Locate()
        {
            if (!File.Exists(_assembly))
                return null;
            var asm = AssemblyDefinition.ReadAssembly(_assembly);
            foreach (var module in asm.Modules)
            {
                var result = locateSimpleType(module.Types);
                if (result != null)
                    return result;
            }
            return null;
        }

        public SimpleType LocateParent()
        {
            var end = _type.LastIndexOf('.');
            if (end == -1)
                return null;
            _type = _type.Substring(0, end);
            return Locate();
{'fraction_non_alphanumeric': 0.07915921288014312, 'fraction_numerical': 0.0017889087656529517, 'mean_word_length': 1.6790419161676646, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1699305', 'n_tokens_mistral': 568, 'n_tokens_neox': 558, 'n_words': 153}