Skip to content

Commit 1efe579

Browse files
committed
Resolve merge conflicts
2 parents 3cd52cc + f44d565 commit 1efe579

File tree

216 files changed

+4280
-2324
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

216 files changed

+4280
-2324
lines changed

Rubberduck.API/VBA/Parser.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212
using Rubberduck.Parsing.Symbols.DeclarationLoaders;
1313
using Rubberduck.Parsing.VBA;
1414
using Rubberduck.Parsing.Symbols;
15-
using Rubberduck.Parsing.Symbols.ParsingExceptions;
1615
using Rubberduck.Parsing.UIContext;
1716
using Rubberduck.Parsing.VBA.ComReferenceLoading;
17+
using Rubberduck.Parsing.VBA.DeclarationCaching;
1818
using Rubberduck.Parsing.VBA.DeclarationResolving;
1919
using Rubberduck.Parsing.VBA.Parsing;
20+
using Rubberduck.Parsing.VBA.Parsing.ParsingExceptions;
2021
using Rubberduck.Parsing.VBA.ReferenceManagement;
2122
using Rubberduck.Resources.Registration;
2223
using Rubberduck.VBEditor.ComManagement;

Rubberduck.CodeAnalysis/CodeMetrics/CodeMetricBase.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System.Collections.Generic;
22
using Rubberduck.Parsing.Grammar;
33
using Rubberduck.Parsing.Symbols;
4+
using Rubberduck.Parsing.VBA.DeclarationCaching;
45
using Rubberduck.VBEditor;
56

67
namespace Rubberduck.CodeAnalysis.CodeMetrics

Rubberduck.CodeAnalysis/CodeMetrics/CodeMetricsAnalyst.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using Rubberduck.VBEditor;
55
using System.Collections.Generic;
66
using System.Linq;
7+
using Rubberduck.Parsing.VBA.DeclarationCaching;
78

89
namespace Rubberduck.CodeAnalysis.CodeMetrics
910
{
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
using Rubberduck.Inspections.CodePathAnalysis.Nodes;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
6+
namespace Rubberduck.Inspections.CodePathAnalysis.Extensions
7+
{
8+
public static class NodeExtensions
9+
{
10+
public static IEnumerable<INode> GetFlattenedNodes(this INode node, IEnumerable<Type> excludedTypes)
11+
{
12+
foreach (var child in node.Children)
13+
{
14+
if (!excludedTypes.Contains(child.GetType()))
15+
{
16+
yield return child;
17+
}
18+
else
19+
{
20+
foreach (var nextChild in GetFlattenedNodes(child, excludedTypes))
21+
{
22+
yield return nextChild;
23+
}
24+
}
25+
}
26+
}
27+
28+
public static IEnumerable<INode> GetNodes(this INode node, IEnumerable<Type> types)
29+
{
30+
if (types.Contains(node.GetType()))
31+
{
32+
yield return node;
33+
}
34+
35+
foreach (var child in node.Children)
36+
{
37+
foreach (var childNode in GetNodes(child, types))
38+
{
39+
yield return childNode;
40+
}
41+
}
42+
}
43+
44+
public static INode GetFirstNode(this INode node, IEnumerable<Type> excludedTypes)
45+
{
46+
if (!excludedTypes.Contains(node.GetType()))
47+
{
48+
return node;
49+
}
50+
51+
return GetFirstNode(node.Children[0], excludedTypes);
52+
}
53+
}
54+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace Rubberduck.Inspections.CodePathAnalysis.Nodes
2+
{
3+
public interface IBranchNode : INode
4+
{
5+
}
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace Rubberduck.Inspections.CodePathAnalysis.Nodes
2+
{
3+
public interface ILoopNode : INode
4+
{
5+
}
6+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using Rubberduck.Parsing.Symbols;
2+
using System.Collections.Immutable;
3+
4+
namespace Rubberduck.Inspections.CodePathAnalysis.Nodes
5+
{
6+
public interface INode
7+
{
8+
int SortOrder { get; set; }
9+
ImmutableList<INode> Children { get; set; }
10+
INode Parent { get; set; }
11+
12+
Declaration Declaration { get; set; }
13+
IdentifierReference Reference { get; set; }
14+
}
15+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System.Collections.Generic;
2+
using System.Collections.Immutable;
3+
using Rubberduck.Parsing.Symbols;
4+
5+
namespace Rubberduck.Inspections.CodePathAnalysis.Nodes
6+
{
7+
public class AssignmentNode : INode
8+
{
9+
public AssignmentNode()
10+
{
11+
Children = new List<INode>().ToImmutableList();
12+
}
13+
14+
public int SortOrder { get; set; }
15+
public ImmutableList<INode> Children { get; set; }
16+
public INode Parent { get; set; }
17+
18+
public Declaration Declaration { get; set; }
19+
public IdentifierReference Reference { get; set; }
20+
}
21+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System.Collections.Generic;
2+
using System.Collections.Immutable;
3+
using Rubberduck.Parsing.Symbols;
4+
5+
namespace Rubberduck.Inspections.CodePathAnalysis.Nodes
6+
{
7+
public class BlockNode : INode
8+
{
9+
public BlockNode()
10+
{
11+
Children = new List<INode>().ToImmutableList();
12+
}
13+
14+
public int SortOrder { get; set; }
15+
public ImmutableList<INode> Children { get; set; }
16+
public INode Parent { get; set; }
17+
18+
public Declaration Declaration { get; set; }
19+
public IdentifierReference Reference { get; set; }
20+
}
21+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System.Collections.Generic;
2+
using System.Collections.Immutable;
3+
using Rubberduck.Parsing.Symbols;
4+
5+
namespace Rubberduck.Inspections.CodePathAnalysis.Nodes
6+
{
7+
public class BranchNode : IBranchNode
8+
{
9+
public BranchNode()
10+
{
11+
Children = new List<INode>().ToImmutableList();
12+
}
13+
14+
public int SortOrder { get; set; }
15+
public ImmutableList<INode> Children { get; set; }
16+
public INode Parent { get; set; }
17+
18+
public Declaration Declaration { get; set; }
19+
public IdentifierReference Reference { get; set; }
20+
}
21+
}

0 commit comments

Comments
 (0)