Showing 13 of 128 total issues
File EncryptedTests.cs
has 605 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using NUnit.Framework;
using Icarus.Core;
using System.IO;
using System;
using Haxxor.Framework.Core.Interfaces;
File IcarusCollection.cs
has 580 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Linq;
using System.Collections.Generic;
File BasicTests.cs
has 578 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using NUnit.Framework;
using Icarus.Core;
using System.IO;
using System;
Class EncryptedTests
has 32 methods (exceeds 20 allowed). Consider refactoring. Open
Open
[TestFixture]
public class EncryptedTests
{
private const string _dataStore = "Test";
Class BasicTests
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
Open
[TestFixture]
public class BasicTests
{
private const string _dataStore = "Test";
Class IcarusCollection
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public class IcarusCollection<T> : IIcarusCollection<T> where T : IIcarusObject
{
#region Constants
Method Update
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public T Update(T item, bool persist = true)
{
if (Equals(item, default(T)))
{
throw new IcarusException("Cannot update an object with null.");
Method LoadJsonData
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void LoadJsonData()
{
try
{
// try decrypting or just reading the data first
Method Insert
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public T Insert(T item, bool persist = true)
{
if (Equals(item, default(T)))
{
throw new IcarusException("Cannot insert null item.");
Method Remove
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public T Remove(long id, bool persist = true)
{
var _item = default(JToken);
var _castItem = default(T);
var _error = false;
Method Find_Filter_SuccessOnDates
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
[TestCase(IcarusEqualityFilter.LessThan, true)]
[TestCase(IcarusEqualityFilter.GreaterThan, false)]
public void Find_Filter_SuccessOnDates(IcarusEqualityFilter filter, bool isNull)
{
Method Find_Filter_SuccessOnDates
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
[TestCase(IcarusEqualityFilter.LessThan, true)]
[TestCase(IcarusEqualityFilter.GreaterThan, false)]
public void Find_Filter_SuccessOnDates(IcarusEqualityFilter filter, bool isNull)
{
Method Update
has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring. Open
Open
public T Update(T item, bool persist = true)
{
if (Equals(item, default(T)))
{
throw new IcarusException("Cannot update an object with null.");
- Read upRead up
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"