Skip to content

Commit

Permalink
Analysis: (CA1002) Do not expose generic lists.
Browse files Browse the repository at this point in the history
  • Loading branch information
am11 committed Dec 23, 2013
1 parent 3a4950f commit de43b97
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static bool IsPixelPushingModeEnabled
}
}
}
public static List<Regex> IgnoreList
public static IEnumerable<Regex> IgnoreList
{
get
{
Expand Down
2 changes: 1 addition & 1 deletion EditorExtensions/BrowserLink/UnusedCss/RawRuleUsage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class RawRuleUsage : IEquatable<RawRuleUsage>
[JsonProperty]
public string Selector { get; set; }
[JsonProperty]
public List<SourceLocation> SourceLocations { get; private set; }
public IEnumerable<SourceLocation> SourceLocations { get; private set; }

public RawRuleUsage()
{
Expand Down
2 changes: 1 addition & 1 deletion EditorExtensions/BrowserLink/UnusedCss/SessionResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class SessionResult : IUsageDataSource, IResolutionRequiredDataSource
[JsonProperty]
public bool Continue { get; set; }
[JsonProperty]
public List<string> Sheets { get; private set; }
public IEnumerable<string> Sheets { get; private set; }

public IEnumerable<IStylingRule> AllRules
{
Expand Down
4 changes: 2 additions & 2 deletions EditorExtensions/BrowserLink/UnusedCss/UnusedCssExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ public class UnusedCssExtension : BrowserLinkExtension
public static bool IsAnyConnectionAlive { get { return ExtensionByConnection.Count > 0; } }
public BrowserLinkConnection Connection { get { return _connection; } }
public bool IsRecording { get; private set; }
public static List<string> IgnoreList
public static IEnumerable<string> IgnoreList
{
get
{
var ignorePatterns = WESettings.GetString(WESettings.Keys.UnusedCss_IgnorePatterns) ?? "";

return ignorePatterns.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim()).ToList();
return ignorePatterns.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim());
}
}
private static List<string> IgnorePatternList
Expand Down
7 changes: 6 additions & 1 deletion EditorExtensions/Commands/Code/IntellisenseWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,17 @@ public class IntellisenseObject
public string FullName { get; set; }
public bool IsEnum { get; set; }
public string Summary { get; set; }
public List<IntellisenseProperty> Properties { get; private set; }
public IList<IntellisenseProperty> Properties { get; private set; }

public IntellisenseObject()
{
Properties = new List<IntellisenseProperty>();
}

public IntellisenseObject(IList<IntellisenseProperty> properties)
{
Properties = properties;
}
}

public class IntellisenseProperty
Expand Down
7 changes: 3 additions & 4 deletions EditorExtensions/Commands/Code/ScriptIntellisenseListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,19 +163,18 @@ private static void ProcessEnum(CodeEnum element, List<IntellisenseObject> list)

private static void ProcessClass(CodeClass cc, List<IntellisenseObject> list)
{
var props = GetProperties(cc.Members, new HashSet<string>()).ToList();
var properties = GetProperties(cc.Members, new HashSet<string>()).ToList();

if (props.Any())
if (properties.Any())
{
var intellisenseObject = new IntellisenseObject
var intellisenseObject = new IntellisenseObject(properties)
{
Namespace = GetNamespace(cc),
Name = cc.Name,
FullName = cc.FullName,
Summary = GetSummary(cc),
};

intellisenseObject.Properties.AddRange(props);
list.Add(intellisenseObject);
}
}
Expand Down

0 comments on commit de43b97

Please sign in to comment.