private IKaVEList <IVersionControlAction> ReadNewGitActionsFrom(IEnumerable <string> logContent)
        {
            var gitActions = Lists.NewList <IVersionControlAction>();

            foreach (var logEntry in logContent)
            {
                var executedAt = ExtractExecutedAtFrom(logEntry);
                var actionType = ExtractActionTypeFrom(logEntry);

                if (executedAt == null || actionType == VersionControlActionType.Unknown)
                {
                    continue;
                }

                var newAction = new VersionControlAction
                {
                    ExecutedAt = executedAt.Value,
                    ActionType = actionType
                };

                if (!_oldActions.Contains(newAction))
                {
                    _oldActions.Add(newAction);
                    gitActions.Add(newAction);
                }
            }

            return(gitActions);
        }
Exemple #2
0
        private static TypeHierarchy CreateTypeHierarchy(ITypeElement type,
                                                         ISubstitution substitution,
                                                         IKaVEList <ITypeName> seenTypes,
                                                         bool shouldIgnoreRootTypes)
        {
            if (shouldIgnoreRootTypes && (type == null || IsRootType(type)))
            {
                // ignore implicite extensions in type hierarchy
                return(null);
            }
            var typeName = type.GetName <ITypeName>(substitution);

            seenTypes.Add(typeName);
            var enclosingClassHierarchy = new TypeHierarchy(typeName.Identifier);

            foreach (var superType in type.GetSuperTypes())
            {
                var resolveResult     = superType.Resolve();
                var declElem          = resolveResult.DeclaredElement;
                var isUnresolvedAlias = declElem is IUsingAliasDirective;
                // TODO NameUpdate: "isUnknownOrUnResolvedUntested" required by one analyzed solution, still untested
                var isUnknownOrUnResolvedUntested = superType.IsUnknown || !superType.IsResolved;
                if (!resolveResult.IsValid() || declElem == null || isUnresolvedAlias || isUnknownOrUnResolvedUntested)
                {
                    enclosingClassHierarchy.Implements.Add(new TypeHierarchy());
                    continue;
                }

                var superName = declElem.GetName <ITypeName>(substitution);
                if (seenTypes.Contains(superName))
                {
                    continue;
                }

                var superTypeElement      = superType.GetTypeElement();
                var superTypeSubstitution = superType.GetSubstitution();
                var superHierarchy        = CreateTypeHierarchy(superTypeElement, superTypeSubstitution, seenTypes, true);

                if (declElem is IClass || declElem is IStruct)
                {
                    enclosingClassHierarchy.Extends = superHierarchy;
                }
                else if (declElem is IInterface)
                {
                    enclosingClassHierarchy.Implements.Add(superHierarchy);
                }
            }
            return(enclosingClassHierarchy);
        }