Showing 7 of 36 total issues
Method DoTask
has a Cognitive Complexity of 80 (exceeds 20 allowed). Consider refactoring. Open
Open
public static void DoTask(Task task)
{
switch (task.Type)
{
case Type.FileSystemDelete:
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method DoTask
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static void DoTask(Task task)
{
switch (task.Type)
{
case Type.FileSystemDelete:
- Create a ticketCreate a ticket
Method HasFileOrDirectoryAccess
has a Cognitive Complexity of 33 (exceeds 20 allowed). Consider refactoring. Open
Open
private bool HasFileOrDirectoryAccess(FileSystemRights right,
AuthorizationRuleCollection acl)
{
bool allow = false;
bool inheritedAllow = false;
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method HasFileOrDirectoryAccess
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private bool HasFileOrDirectoryAccess(FileSystemRights right,
AuthorizationRuleCollection acl)
{
bool allow = false;
bool inheritedAllow = false;
- Create a ticketCreate a ticket
Method Read
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static Status Read(string memoPath)
{
bool readSuccess = false;
bool tasksStarted = false;
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
Open
if (currentRule.IsInherited)
{
inheritedDeny = true;
}
else
- Create a ticketCreate a ticket
Method GetTokenInformation
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static extern bool GetTokenInformation(IntPtr TokenHandle, TokenInformationClass TokenInformationClass, IntPtr TokenInformation, uint TokenInformationLength, out uint ReturnLength);
- Create a ticketCreate a ticket