<commit_before>﻿using System;
using System.IO;
using System.Reflection;
using NServiceBus;
using NServiceBus.Settings;

static class ScriptLocation
{
    public static string FindScriptDirectory(ReadOnlySettings settings)
    {
        var currentDirectory = GetCurrentDirectory(settings);
        return Path.Combine(currentDirectory, "NServiceBus.Persistence.Sql", settings.GetSqlDialect().Name);
    }

    static string GetCurrentDirectory(ReadOnlySettings settings)
    {
		string scriptDirectory;
        if (settings.TryGet("SqlPersistence.ScriptDirectory", out scriptDirectory))
        {
            return scriptDirectory;
        }
        var entryAssembly = Assembly.GetEntryAssembly();
        if (entryAssembly == null)
        {
            return AppDomain.CurrentDomain.BaseDirectory;
        }
        var codeBase = entryAssembly.CodeBase;
        return Directory.GetParent(new Uri(codeBase).LocalPath).FullName;
    }

    public static void ValidateScriptExists(string createScript)
    {
        if (!File.Exists(createScript))
        {
            throw new Exception($"Expected '{createScript}' to exist. It is possible it was not deployed with the endpoint or NServiceBus.Persistence.Sql.MsBuild nuget was not included in the project.");
        }
    }
}<commit_msg>Fix inspection error<commit_after>﻿using System;
using System.IO;
using System.Reflection;
using NServiceBus;
using NServiceBus.Settings;

static class ScriptLocation
{
    public static string FindScriptDirectory(ReadOnlySettings settings)
    {
        var currentDirectory = GetCurrentDirectory(settings);
        return Path.Combine(currentDirectory, "NServiceBus.Persistence.Sql", settings.GetSqlDialect().Name);
    }

    static string GetCurrentDirectory(ReadOnlySettings settings)
    {
        if (settings.TryGet("SqlPersistence.ScriptDirectory", out string scriptDirectory))
        {
            return scriptDirectory;
        }
        var entryAssembly = Assembly.GetEntryAssembly();
        if (entryAssembly == null)
        {
            return AppDomain.CurrentDomain.BaseDirectory;
        }
        var codeBase = entryAssembly.CodeBase;
        return Directory.GetParent(new Uri(codeBase).LocalPath).FullName;
    }

    public static void ValidateScriptExists(string createScript)
    {
        if (!File.Exists(createScript))
        {
            throw new Exception($"Expected '{createScript}' to exist. It is possible it was not deployed with the endpoint or NServiceBus.Persistence.Sql.MsBuild nuget was not included in the project.");
        }
    }
}
{'fraction_non_alphanumeric': 0.08107059736229635, 'fraction_numerical': 0.0, 'mean_word_length': 3.1330128205128207, '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': '2215995', 'n_tokens_mistral': 645, 'n_tokens_neox': 640, 'n_words': 167}