Skip to content

Commit

Permalink
Merge pull request lucaslorentz#27 from rohitjha/cleanup
Browse files Browse the repository at this point in the history
Clean up code
  • Loading branch information
lucaslorentz authored Feb 14, 2018
2 parents 6c7c872 + 1f6e2f2 commit 5d0bbc5
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 32 deletions.
2 changes: 0 additions & 2 deletions src/MiniCover/Extensions/AssemblyDefinitionExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using Mono.Cecil;
using System;
using System.Collections.Generic;
using System.Text;

namespace MiniCover.Extensions
{
Expand Down
3 changes: 1 addition & 2 deletions src/MiniCover/Extensions/DocumentExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Mono.Cecil.Cil;
using System;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
Expand Down Expand Up @@ -39,4 +38,4 @@ private static HashAlgorithm CreateHashAlgorithm(DocumentHashAlgorithm algorithm
}
}
}
}
}
5 changes: 1 addition & 4 deletions src/MiniCover/Extensions/SequencePointExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using Mono.Cecil.Cil;
using System;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Collections.Generic;

namespace MiniCover.Extensions
Expand Down Expand Up @@ -61,4 +58,4 @@ public static string ExtractCode(this SequencePoint sequencePoint, string[] file
}
}
}
}
}
7 changes: 3 additions & 4 deletions src/MiniCover/Extensions/TypeDefinitionExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Mono.Cecil;
using Mono.Cecil.Cil;
using System;
using System.Collections.Generic;
using System.Linq;

Expand All @@ -13,9 +12,9 @@ public static MethodDefinition FindOrCreateCctor(this TypeDefinition typeDefinit
var cctor = typeDefinition.Methods.FirstOrDefault(x => x.Name == ".cctor");
if (cctor == null)
{
var attributes = Mono.Cecil.MethodAttributes.Static
| Mono.Cecil.MethodAttributes.SpecialName
| Mono.Cecil.MethodAttributes.RTSpecialName;
var attributes = MethodAttributes.Static
| MethodAttributes.SpecialName
| MethodAttributes.RTSpecialName;
cctor = new MethodDefinition(".cctor", attributes, typeDefinition.Module.TypeSystem.Void);
typeDefinition.Methods.Add(cctor);
cctor.Body.Instructions.Add(Instruction.Create(OpCodes.Ret));
Expand Down
8 changes: 2 additions & 6 deletions src/MiniCover/HitService.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading;

namespace MiniCover
{
public static class HitService
{
private static object lockObject = new object();
private static readonly object lockObject = new object();
private static Dictionary<string, StreamWriter> writers = new Dictionary<string, StreamWriter>();

public static void Init(string fileName)
Expand Down
2 changes: 0 additions & 2 deletions src/MiniCover/Instrumentation/InstrumentedAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace MiniCover.Instrumentation
{
Expand Down
4 changes: 2 additions & 2 deletions src/MiniCover/Instrumentation/Instrumenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace MiniCover.Instrumentation
{
public class Instrumenter
{
private int id = 0;
private int id;
private IList<string> assemblies;
private string hitsFile;
private IList<string> sourceFiles;
Expand Down Expand Up @@ -365,4 +365,4 @@ private string GetMiniCoverTempPath()
return path;
}
}
}
}
4 changes: 1 addition & 3 deletions src/MiniCover/Model/AssemblyLocation.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.Collections.Generic;

namespace MiniCover.Model
{
public class AssemblyLocation
Expand All @@ -9,4 +7,4 @@ public class AssemblyLocation
public string PdbFile { get; set; }
public string BackupPdbFile { get; set; }
}
}
}
1 change: 0 additions & 1 deletion src/MiniCover/Model/InstrumentationResult.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Newtonsoft.Json;
using System.Collections.Generic;
using System.Linq;
using System;

namespace MiniCover.Model
{
Expand Down
1 change: 0 additions & 1 deletion src/MiniCover/Reports/HtmlReport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using MiniCover.Model;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;

Expand Down
6 changes: 1 addition & 5 deletions test/MiniCover.Tests/AnotherClass.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace MiniCover.Tests
namespace MiniCover.Tests
{
public class AnotherClass
{
Expand Down

0 comments on commit 5d0bbc5

Please sign in to comment.