BinToss/Intern

View on GitHub

Showing 7 of 36 total issues

Method DoTask has a Cognitive Complexity of 80 (exceeds 20 allowed). Consider refactoring.
Open

        public static void DoTask(Task task)
        {
            switch (task.Type)
            {
                case Type.FileSystemDelete:
Severity: Minor
Found in Tasks.cs - About 1 day to fix

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

        public static void DoTask(Task task)
        {
            switch (task.Type)
            {
                case Type.FileSystemDelete:
Severity: Major
Found in Tasks.cs - About 3 hrs to fix

Method HasFileOrDirectoryAccess has a Cognitive Complexity of 33 (exceeds 20 allowed). Consider refactoring.
Open

        private bool HasFileOrDirectoryAccess(FileSystemRights right,
                                              AuthorizationRuleCollection acl)
        {
            bool allow = false;
            bool inheritedAllow = false;
Severity: Minor
Found in ext/ACLHelper/UserSecurity.cs - About 2 hrs to fix

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

        private bool HasFileOrDirectoryAccess(FileSystemRights right,
                                              AuthorizationRuleCollection acl)
        {
            bool allow = false;
            bool inheritedAllow = false;
Severity: Minor
Found in ext/ACLHelper/UserSecurity.cs - About 1 hr to fix

Method Read has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        public static Status Read(string memoPath)
        {
            bool readSuccess = false;
            bool tasksStarted = false;

Severity: Minor
Found in Memo.cs - About 1 hr to fix

Avoid deeply nested control flow statements.
Open

                            if (currentRule.IsInherited)
                            {
                                inheritedDeny = true;
                            }
                            else
Severity: Major
Found in ext/ACLHelper/UserSecurity.cs - About 45 mins to fix

Method GetTokenInformation has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        public static extern bool GetTokenInformation(IntPtr TokenHandle, TokenInformationClass TokenInformationClass, IntPtr TokenInformation, uint TokenInformationLength, out uint ReturnLength);
Severity: Minor
Found in ext/UacHelper.cs - About 35 mins to fix
Severity
Category
Status
Source
Language