Skip to content

Commit

Permalink
Refactoring for performance.
Browse files Browse the repository at this point in the history
  • Loading branch information
cassiodeveloper committed Jun 21, 2016
1 parent 96bb6fa commit 6848c6c
Show file tree
Hide file tree
Showing 69 changed files with 2,590 additions and 26 deletions.
Binary file added .vs/RobotsExplorer/v14/.suo
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ C:\Users\mtzcpd1053\Documents\src\RobotsExplorer\RobotsExplorer.ConfigManager\bi
C:\Users\mtzcpd1053\Documents\src\RobotsExplorer\RobotsExplorer.ConfigManager\obj\Debug\RobotsExplorer.ConfigManager.csprojResolveAssemblyReference.cache
C:\Users\mtzcpd1053\Documents\src\RobotsExplorer\RobotsExplorer.ConfigManager\obj\Debug\RobotsExplorer.ConfigManager.dll
C:\Users\mtzcpd1053\Documents\src\RobotsExplorer\RobotsExplorer.ConfigManager\obj\Debug\RobotsExplorer.ConfigManager.pdb
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.ConfigManager\bin\Debug\RobotsExplorer.ConfigManager.dll
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.ConfigManager\bin\Debug\RobotsExplorer.ConfigManager.pdb
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.ConfigManager\obj\Debug\RobotsExplorer.ConfigManager.csprojResolveAssemblyReference.cache
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.ConfigManager\obj\Debug\RobotsExplorer.ConfigManager.dll
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.ConfigManager\obj\Debug\RobotsExplorer.ConfigManager.pdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified RobotsExplorer.HttpManager/bin/Debug/RobotsExplorer.HttpManager.dll
Binary file not shown.
Binary file not shown.
Binary file modified RobotsExplorer.HttpManager/bin/Debug/RobotsExplorer.Model.dll
Binary file not shown.
Binary file modified RobotsExplorer.HttpManager/bin/Debug/RobotsExplorer.Model.pdb
Binary file not shown.
Binary file modified RobotsExplorer.HttpManager/bin/Debug/RobotsExplorer.Util.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,12 @@ C:\Users\mtzcpd1053\Documents\src\RobotsExplorer\RobotsExplorer.HttpManager\bin\
C:\Users\mtzcpd1053\Documents\src\RobotsExplorer\RobotsExplorer.HttpManager\obj\Debug\RobotsExplorer.HttpManager.csprojResolveAssemblyReference.cache
C:\Users\mtzcpd1053\Documents\src\RobotsExplorer\RobotsExplorer.HttpManager\obj\Debug\RobotsExplorer.HttpManager.dll
C:\Users\mtzcpd1053\Documents\src\RobotsExplorer\RobotsExplorer.HttpManager\obj\Debug\RobotsExplorer.HttpManager.pdb
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.HttpManager\bin\Debug\RobotsExplorer.HttpManager.dll
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.HttpManager\bin\Debug\RobotsExplorer.HttpManager.pdb
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.HttpManager\bin\Debug\RobotsExplorer.Model.dll
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.HttpManager\bin\Debug\RobotsExplorer.Util.dll
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.HttpManager\bin\Debug\RobotsExplorer.Model.pdb
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.HttpManager\bin\Debug\RobotsExplorer.Util.pdb
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.HttpManager\obj\Debug\RobotsExplorer.HttpManager.csprojResolveAssemblyReference.cache
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.HttpManager\obj\Debug\RobotsExplorer.HttpManager.dll
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.HttpManager\obj\Debug\RobotsExplorer.HttpManager.pdb
Binary file not shown.
Binary file modified RobotsExplorer.HttpManager/obj/Debug/RobotsExplorer.HttpManager.dll
Binary file not shown.
Binary file not shown.
Binary file modified RobotsExplorer.Model/bin/Debug/RobotsExplorer.Model.dll
Binary file not shown.
Binary file modified RobotsExplorer.Model/bin/Debug/RobotsExplorer.Model.pdb
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ C:\Users\mtzcpd1053\Documents\src\RobotsExplorer\RobotsExplorer.Model\bin\Debug\
C:\Users\mtzcpd1053\Documents\src\RobotsExplorer\RobotsExplorer.Model\obj\Debug\RobotsExplorer.Model.csprojResolveAssemblyReference.cache
C:\Users\mtzcpd1053\Documents\src\RobotsExplorer\RobotsExplorer.Model\obj\Debug\RobotsExplorer.Model.dll
C:\Users\mtzcpd1053\Documents\src\RobotsExplorer\RobotsExplorer.Model\obj\Debug\RobotsExplorer.Model.pdb
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.Model\bin\Debug\RobotsExplorer.Model.dll
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.Model\bin\Debug\RobotsExplorer.Model.pdb
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.Model\obj\Debug\RobotsExplorer.Model.csprojResolveAssemblyReference.cache
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.Model\obj\Debug\RobotsExplorer.Model.dll
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.Model\obj\Debug\RobotsExplorer.Model.pdb
Binary file not shown.
Binary file modified RobotsExplorer.Model/obj/Debug/RobotsExplorer.Model.dll
Binary file not shown.
Binary file modified RobotsExplorer.Model/obj/Debug/RobotsExplorer.Model.pdb
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Binary file modified RobotsExplorer.Test/bin/Debug/RobotsExplorer.HttpManager.dll
Binary file not shown.
Binary file not shown.
Binary file modified RobotsExplorer.Test/bin/Debug/RobotsExplorer.Model.dll
Binary file not shown.
Binary file modified RobotsExplorer.Test/bin/Debug/RobotsExplorer.Model.pdb
Binary file not shown.
Binary file modified RobotsExplorer.Test/bin/Debug/RobotsExplorer.Test.dll
Binary file not shown.
Binary file modified RobotsExplorer.Test/bin/Debug/RobotsExplorer.Test.pdb
Binary file not shown.
Binary file modified RobotsExplorer.Test/bin/Debug/RobotsExplorer.Util.dll
Binary file not shown.
Binary file modified RobotsExplorer.Test/bin/Debug/RobotsExplorer.Util.pdb
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,16 @@ C:\Users\mtzcpd1053\Documents\src\RobotsExplorer\RobotsExplorer.Test\obj\Debug\R
C:\Users\mtzcpd1053\Documents\src\RobotsExplorer\RobotsExplorer.Test\obj\Debug\RobotsExplorer.Test.pdb
C:\Users\mtzcpd1053\Documents\src\RobotsExplorer\RobotsExplorer.Test\bin\Debug\RobotsExplorer.HttpManager.dll
C:\Users\mtzcpd1053\Documents\src\RobotsExplorer\RobotsExplorer.Test\bin\Debug\RobotsExplorer.HttpManager.pdb
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.Test\bin\Debug\RobotsExplorer.Test.dll
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.Test\bin\Debug\RobotsExplorer.Test.pdb
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.Test\bin\Debug\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.Test\bin\Debug\RobotsExplorer.HttpManager.dll
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.Test\bin\Debug\RobotsExplorer.Model.dll
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.Test\bin\Debug\RobotsExplorer.Util.dll
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.Test\bin\Debug\RobotsExplorer.HttpManager.pdb
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.Test\bin\Debug\RobotsExplorer.Model.pdb
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.Test\bin\Debug\RobotsExplorer.Util.pdb
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.Test\bin\Debug\Microsoft.VisualStudio.QualityTools.UnitTestFramework.xml
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.Test\obj\Debug\RobotsExplorer.Test.csprojResolveAssemblyReference.cache
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.Test\obj\Debug\RobotsExplorer.Test.dll
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.Test\obj\Debug\RobotsExplorer.Test.pdb
Binary file not shown.
Binary file modified RobotsExplorer.Test/obj/Debug/RobotsExplorer.Test.dll
Binary file not shown.
Binary file modified RobotsExplorer.Test/obj/Debug/RobotsExplorer.Test.pdb
Binary file not shown.
Binary file modified RobotsExplorer.Util/bin/Debug/RobotsExplorer.Model.dll
Binary file not shown.
Binary file modified RobotsExplorer.Util/bin/Debug/RobotsExplorer.Model.pdb
Binary file not shown.
Binary file modified RobotsExplorer.Util/bin/Debug/RobotsExplorer.Util.dll
Binary file not shown.
Binary file modified RobotsExplorer.Util/bin/Debug/RobotsExplorer.Util.pdb
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@ C:\Users\mtzcpd1053\Documents\src\RobotsExplorer\RobotsExplorer.Util\bin\Debug\R
C:\Users\mtzcpd1053\Documents\src\RobotsExplorer\RobotsExplorer.Util\obj\Debug\RobotsExplorer.Util.csprojResolveAssemblyReference.cache
C:\Users\mtzcpd1053\Documents\src\RobotsExplorer\RobotsExplorer.Util\obj\Debug\RobotsExplorer.Util.dll
C:\Users\mtzcpd1053\Documents\src\RobotsExplorer\RobotsExplorer.Util\obj\Debug\RobotsExplorer.Util.pdb
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.Util\bin\Debug\RobotsExplorer.Util.dll
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.Util\bin\Debug\RobotsExplorer.Util.pdb
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.Util\bin\Debug\RobotsExplorer.Model.dll
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.Util\bin\Debug\RobotsExplorer.Model.pdb
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.Util\obj\Debug\RobotsExplorer.Util.csprojResolveAssemblyReference.cache
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.Util\obj\Debug\RobotsExplorer.Util.dll
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer.Util\obj\Debug\RobotsExplorer.Util.pdb
Binary file not shown.
Binary file modified RobotsExplorer.Util/obj/Debug/RobotsExplorer.Util.dll
Binary file not shown.
Binary file modified RobotsExplorer.Util/obj/Debug/RobotsExplorer.Util.pdb
Binary file not shown.
7 changes: 5 additions & 2 deletions RobotsExplorer.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.40629.0
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RobotsExplorer", "RobotsExplorer\RobotsExplorer.csproj", "{8D31A2BF-FAFD-4415-ADB4-2980C33E7418}"
EndProject
Expand Down Expand Up @@ -61,4 +61,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(CodealikeProperties) = postSolution
SolutionGuid = 4be17286-5830-419e-a0d4-0f4f4329ba9a
EndGlobalSection
EndGlobal
40 changes: 16 additions & 24 deletions RobotsExplorer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ private static void Execute()

if (CanMakeMoreRequest())
{
WebRequest request = httpManager.WebRequestFactory(_urlTarget, _proxy, _userAgent, _requestTimeout);
WebResponse response = request.GetResponse();
var request = httpManager.WebRequestFactory(_urlTarget, _proxy, _userAgent, _requestTimeout);
var response = request.GetResponse();

controlRequestQuantity++;

Expand Down Expand Up @@ -155,8 +155,10 @@ private static void ValidadeOptionsInput()

if (!string.IsNullOrEmpty(_domainList))
{
domainNames = new Domain();
domainNames.DomainNames = new List<string>();
domainNames = new Domain
{
DomainNames = new List<string>()
};

try
{
Expand All @@ -174,7 +176,7 @@ private static void ValidadeOptionsInput()

private static bool ValidadeRequiredOptionsInput()
{
bool valid = false;
var valid = false;

if (string.IsNullOrEmpty(_urlTarget))
DisplayHelp(options);
Expand All @@ -200,18 +202,11 @@ private static void DisplayVersion()

private static bool CanMakeMoreRequest()
{
if (controlRequestQuantity <= _requestQuantity)
return true;
else
return false;
return controlRequestQuantity <= _requestQuantity ? true : false;
}

#endregion





private static void FinishExecution()
{
Util.Util.ChangeConsoleColorToDefault();
Expand Down Expand Up @@ -249,8 +244,8 @@ private static void Attack(string domain, string directory)
{
PauseExecution(_requestTimeInterval);

WebRequest request = httpManager.WebRequestFactory(domain + directory, _proxy, _userAgent, _requestTimeout);
WebResponse response = request.GetResponse();
var request = httpManager.WebRequestFactory(domain + directory, _proxy, _userAgent, _requestTimeout);
var response = request.GetResponse();

controlRequestQuantity++;

Expand Down Expand Up @@ -303,7 +298,7 @@ private static void ProcessResponse(HttpWebResponse response)

WriteMessageAndSkipLine("Getting Robots.txt...", 1);

string robotsTxt = Util.Util.ParseResponseStreamToText(response);
var robotsTxt = Util.Util.ParseResponseStreamToText(response);

Util.Util.ChangeConsoleColorToGreen();

Expand Down Expand Up @@ -352,8 +347,8 @@ private static void SiteMapXmlFile(Robot robot)
{
robot.SiteMap = new SiteMap();

WebRequest request = httpManager.WebRequestFactory(robot.SiteMaps[0], _proxy, _userAgent, _requestTimeout);
WebResponse response = request.GetResponse();
var request = httpManager.WebRequestFactory(robot.SiteMaps[0], _proxy, _userAgent, _requestTimeout);
var response = request.GetResponse();

controlRequestQuantity++;

Expand All @@ -367,7 +362,7 @@ private static void SiteMapXmlFile(Robot robot)

Util.Util.ChangeConsoleColorToDefault();

string fullPath = Util.Util.SaveFile(robot.SiteMap.SiteMapData.InnerXml, _urlTarget);
var fullPath = Util.Util.SaveFile(robot.SiteMap.SiteMapData.InnerXml, _urlTarget);

WriteMessageAndSkipLine("-------------------------------------------", 1);
WriteMessageAndSkipLine("Sitemap file downloaded at: " + fullPath, 1);
Expand All @@ -384,7 +379,7 @@ private static void SiteMapXmlFile(Robot robot)

private static bool AskUser(string questionText)
{
string answer = string.Empty;
var answer = string.Empty;

do
{
Expand All @@ -400,10 +395,7 @@ private static bool AskUser(string questionText)

} while (answer.ToUpper() != "Y" && answer.ToUpper() != "N");

if (answer.ToUpper() == "Y")
return true;
else
return false;
return answer.ToUpper() == "Y" ? true : false;
}

private static string GetRobotsExplorerVersion()
Expand Down
Binary file modified RobotsExplorer/bin/Debug/RobotsExplorer.ConfigManager.dll
Binary file not shown.
Binary file modified RobotsExplorer/bin/Debug/RobotsExplorer.ConfigManager.pdb
Binary file not shown.
Binary file modified RobotsExplorer/bin/Debug/RobotsExplorer.HttpManager.dll
Binary file not shown.
Binary file modified RobotsExplorer/bin/Debug/RobotsExplorer.HttpManager.pdb
Binary file not shown.
Binary file modified RobotsExplorer/bin/Debug/RobotsExplorer.Model.dll
Binary file not shown.
Binary file modified RobotsExplorer/bin/Debug/RobotsExplorer.Model.pdb
Binary file not shown.
Binary file modified RobotsExplorer/bin/Debug/RobotsExplorer.Util.dll
Binary file not shown.
Binary file modified RobotsExplorer/bin/Debug/RobotsExplorer.Util.pdb
Binary file not shown.
Binary file modified RobotsExplorer/bin/Debug/RobotsExplorer.exe
Binary file not shown.
Binary file modified RobotsExplorer/bin/Debug/RobotsExplorer.pdb
Binary file not shown.
Binary file modified RobotsExplorer/bin/Debug/RobotsExplorer.vshost.exe
Binary file not shown.
11 changes: 11 additions & 0 deletions RobotsExplorer/bin/Debug/RobotsExplorer.vshost.exe.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,18 @@ C:\Users\mtzcpd1053\Documents\src\RobotsExplorer\RobotsExplorer\bin\Debug\Robots
C:\Users\mtzcpd1053\Documents\src\RobotsExplorer\RobotsExplorer\bin\Debug\RobotsExplorer.Model.pdb
C:\Users\mtzcpd1053\Documents\src\RobotsExplorer\RobotsExplorer\bin\Debug\RobotsExplorer.Util.pdb
C:\Users\mtzcpd1053\Documents\src\RobotsExplorer\RobotsExplorer\obj\Debug\RobotsExplorer.csprojResolveAssemblyReference.cache
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer\bin\Debug\RobotsExplorer.exe.config
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer\obj\Debug\RobotsExplorer.exe
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer\obj\Debug\RobotsExplorer.pdb
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer\bin\Debug\RobotsExplorer.exe
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer\bin\Debug\RobotsExplorer.pdb
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer\bin\Debug\NDesk.Options.dll
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer\bin\Debug\RobotsExplorer.ConfigManager.dll
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer\bin\Debug\RobotsExplorer.HttpManager.dll
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer\bin\Debug\RobotsExplorer.Model.dll
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer\bin\Debug\RobotsExplorer.Util.dll
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer\bin\Debug\RobotsExplorer.ConfigManager.pdb
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer\bin\Debug\RobotsExplorer.HttpManager.pdb
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer\bin\Debug\RobotsExplorer.Model.pdb
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer\bin\Debug\RobotsExplorer.Util.pdb
F:\Cássio\Documents\GitHub\robotsexplorer\RobotsExplorer\obj\Debug\RobotsExplorer.csprojResolveAssemblyReference.cache
Binary file not shown.
Binary file modified RobotsExplorer/obj/Debug/RobotsExplorer.exe
Binary file not shown.
Binary file modified RobotsExplorer/obj/Debug/RobotsExplorer.pdb
Binary file not shown.

0 comments on commit 6848c6c

Please sign in to comment.