<commit_before>using System;
using System.Linq;
using System.Reflection;

namespace Clee.Types
{
    public class CommandScanner
    {
        public Type[] Scan(Assembly assembly)
        {
            return assembly
                .GetTypes()
                .Where(x => x.IsClass)
                .Where(x => IsAssignableToGenericType(x, typeof (ICommand<>)))
                .ToArray();
        }

        public Type[] Scan(Assembly assembly, string namespaceQualifier)
        {
            return Scan(assembly)
                .Where(x => x.Namespace.StartsWith(namespaceQualifier))
                .ToArray();
        }

        private static bool IsAssignableToGenericType(Type givenType, Type genericType)
        {
            var interfaceTypes = givenType.GetInterfaces();
<commit_msg>added filter on public types in command scanner<commit_after>using System;
using System.Linq;
using System.Reflection;

namespace Clee.Types
{
    public class CommandScanner
    {
        public Type[] Scan(Assembly assembly)
        {
            return assembly
                .GetTypes()
                .Where(x => x.IsClass)
                .Where(x => x.IsPublic  || x.IsNestedPublic)
                .Where(x => IsAssignableToGenericType(x, typeof(ICommand<>)))
                .ToArray();
        }

        public Type[] Scan(Assembly assembly, string namespaceQualifier)
        {
            return Scan(assembly)
                .Where(x => x.Namespace.StartsWith(namespaceQualifier))
                .ToArray();
        }

        private static bool IsAssignableToGenericType(Type givenType, Type genericType)
        {
            var interfaceTypes = givenType.GetInterfaces();

{'fraction_non_alphanumeric': 0.09128386336866902, 'fraction_numerical': 0.0, 'mean_word_length': 1.8993174061433447, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, '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': '3383343', 'n_tokens_mistral': 446, 'n_tokens_neox': 427, 'n_words': 101}