Showing 124 of 124 total issues
Method CsharpCode
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public string CsharpCode(
string testNamespace,
IEnumerable<string> usings,
Type type)
{
Method DoAssertion
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
void DoAssertion(int assertIndex, string cSharpClassName, string cSharpVariableName)
{
string excelPropertyName = excel.CurrentCell();
string simpleCSharpPropertyName = converter.AssertPropertyExcelNameToCodeName(excelPropertyName);
excel.MoveRight();
Method GetCellValue
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
private object GetCellValue(Cell cell)
{
if (cell != null)
{
if (cell.DataType != null && cell.DataType.HasValue)
Method ExcelToCodeVisitsTableComplexProperties
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public void ExcelToCodeVisitsTableComplexProperties()
{
var visitRecorder = new GivenTablePropertyVisitRecorder();
Method RationaliseSimpleProperties
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
static List<IVisitedGivenSimpleProperty> RationaliseSimpleProperties(List<IVisitedGivenSimpleProperty> simplePropertiesWithoutNullComplexProperties)
{
var rationalisedSimpleProperties = new List<IVisitedGivenSimpleProperty>();
foreach (var givenSimpleProperty in simplePropertiesWithoutNullComplexProperties)
{
- 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"
Further reading
Method CreateObjectsFromTable
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
void CreateObjectsFromTable(
string tableStartCellReference,
string excelGivenLeft,
string excelGivenRightString)
{
Method SupportsIEnumerableProperties
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
public void SupportsIEnumerableProperties()
{
var excelGivenClass = ExcelGivenClass(
"Target",
Method GetWriter
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
ITestOutputWriter GetWriter()
{
var writers = new List<ITestOutputWriter>();
if (debugOutput)
Method MakeInfinityAString
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private object MakeInfinityAString(object cellValue)
{
if (cellValue is double || cellValue is float)
{
float val;
- 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"
Further reading
Method GetDateTimeCellFormats
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static Dictionary<uint, NumberingFormat> GetDateTimeCellFormats(WorkbookPart workbookPart)
{
Dictionary<uint, NumberingFormat> dateNumberFormats;
if (workbookPart.WorkbookStylesPart.Stylesheet.NumberingFormats == null)
dateNumberFormats = new Dictionary<uint, NumberingFormat>();
- 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"
Further reading
Method AddRow
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void AddRow(Row row)
{
rowLookupCache = null;
rowLookupCacheAssociatedSheet = null;
rowLookupCacheEnumerator = null;
Method GetOrAddCell
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected Cell GetOrAddCell(uint columnIndex, uint rowIndex)
{
string columnName = GetColumnName(columnIndex);
string cellReference = columnName + rowIndex;
Method SetPropertyOnTableRowVariable
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
void SetPropertyOnTableRowVariable(
Dictionary<uint, TableHeader> headers,
uint tableRow,
uint tableColumn)
{
Method NestedFiles
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
[Test]
// cedd 2014-06-30: this test is a bit big and complicated ....
public void NestedFiles()
{
const int NestingDepth = 5; // must be greater than one for test to make sense
Method CalculateVermeulenNearWakeLength
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
IVermeulenNearWakeLength CalculateVermeulenNearWakeLength(IVermeulenNearWakeLengthInput input)
{
// I have copied the formulas from Excel, which helps a lot when writing the calculation.
// A lot of the formulas used named ranges, but this only to works when the named
// ranges are on the same row.
Method ReadAssertionTableHeaders
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
IEnumerable<AssertionTableHeader> ReadAssertionTableHeaders()
{
var assertionTableHeaders = new List<AssertionTableHeader>();
using (excel.SavePosition())
Method RationaliseSimpleProperties
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
static List<IVisitedGivenSimpleProperty> RationaliseSimpleProperties(List<IVisitedGivenSimpleProperty> simplePropertiesWithoutNullComplexProperties)
{
var rationalisedSimpleProperties = new List<IVisitedGivenSimpleProperty>();
foreach (var givenSimpleProperty in simplePropertiesWithoutNullComplexProperties)
{
Method Main
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
static int Main(string[] args)
{
try
{
string folder = GetSetting(args, "folder");
Method GetRow
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public Row GetRow(uint rowIndex)
{
if (rowLookupCacheAssociatedSheet != sheetData)
{
rowLookupCache = new Dictionary<uint, Row>();
Method ExcelPropertyTypeFromCellValue
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public ExcelPropertyType ExcelPropertyTypeFromCellValue(object excelPropertyValue)
{
if (excelPropertyValue == null)
return ExcelPropertyType.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"