Badgerati/Icarus

View on GitHub

Showing 13 of 128 total issues

File EncryptedTests.cs has 605 lines of code (exceeds 250 allowed). Consider refactoring.
Open

using NUnit.Framework;
using Icarus.Core;
using System.IO;
using System;
using Haxxor.Framework.Core.Interfaces;
Severity: Major
Found in Icarus.Test/EncryptedTests.cs - About 1 day to fix

    File IcarusCollection.cs has 580 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    using Newtonsoft.Json;
    using Newtonsoft.Json.Linq;
    using System;
    using System.Linq;
    using System.Collections.Generic;
    Severity: Major
    Found in Icarus.Core/IcarusCollection.cs - About 1 day to fix

      File BasicTests.cs has 578 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      using NUnit.Framework;
      using Icarus.Core;
      using System.IO;
      using System;
      
      
      Severity: Major
      Found in Icarus.Test/BasicTests.cs - About 1 day to fix

        Class EncryptedTests has 32 methods (exceeds 20 allowed). Consider refactoring.
        Open

            [TestFixture]
            public class EncryptedTests
            {
        
                private const string _dataStore = "Test";
        Severity: Minor
        Found in Icarus.Test/EncryptedTests.cs - About 4 hrs to fix

          Class BasicTests has 31 methods (exceeds 20 allowed). Consider refactoring.
          Open

              [TestFixture]
              public class BasicTests
              {
          
                  private const string _dataStore = "Test";
          Severity: Minor
          Found in Icarus.Test/BasicTests.cs - About 3 hrs to fix

            Class IcarusCollection has 27 methods (exceeds 20 allowed). Consider refactoring.
            Open

                public class IcarusCollection<T> : IIcarusCollection<T> where T : IIcarusObject
                {
            
                    #region Constants
            
            
            Severity: Minor
            Found in Icarus.Core/IcarusCollection.cs - About 3 hrs to fix

              Method Update has 61 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      public T Update(T item, bool persist = true)
                      {
                          if (Equals(item, default(T)))
                          {
                              throw new IcarusException("Cannot update an object with null.");
              Severity: Major
              Found in Icarus.Core/IcarusCollection.cs - About 2 hrs to fix

                Method LoadJsonData has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        private void LoadJsonData()
                        {
                            try
                            {
                                // try decrypting or just reading the data first
                Severity: Minor
                Found in Icarus.Core/IcarusCollection.cs - About 1 hr to fix

                  Method Insert has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          public T Insert(T item, bool persist = true)
                          {
                              if (Equals(item, default(T)))
                              {
                                  throw new IcarusException("Cannot insert null item.");
                  Severity: Minor
                  Found in Icarus.Core/IcarusCollection.cs - About 1 hr to fix

                    Method Remove has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            public T Remove(long id, bool persist = true)
                            {
                                var _item = default(JToken);
                                var _castItem = default(T);
                                var _error = false;
                    Severity: Minor
                    Found in Icarus.Core/IcarusCollection.cs - About 1 hr to fix

                      Method Find_Filter_SuccessOnDates has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              [Test]
                              [TestCase(IcarusEqualityFilter.LessThan, true)]
                              [TestCase(IcarusEqualityFilter.GreaterThan, false)]
                              public void Find_Filter_SuccessOnDates(IcarusEqualityFilter filter, bool isNull)
                              {
                      Severity: Minor
                      Found in Icarus.Test/BasicTests.cs - About 1 hr to fix

                        Method Find_Filter_SuccessOnDates has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                [Test]
                                [TestCase(IcarusEqualityFilter.LessThan, true)]
                                [TestCase(IcarusEqualityFilter.GreaterThan, false)]
                                public void Find_Filter_SuccessOnDates(IcarusEqualityFilter filter, bool isNull)
                                {
                        Severity: Minor
                        Found in Icarus.Test/EncryptedTests.cs - About 1 hr to fix

                          Method Update has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
                          Open

                                  public T Update(T item, bool persist = true)
                                  {
                                      if (Equals(item, default(T)))
                                      {
                                          throw new IcarusException("Cannot update an object with null.");
                          Severity: Minor
                          Found in Icarus.Core/IcarusCollection.cs - About 1 hr 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

                          Severity
                          Category
                          Status
                          Source
                          Language