resgroup/customer-tests-excel

View on GitHub

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();
    Severity: Minor
    Found in CustomerTestsExcel/ExcelToCode/ExcelToCodeThen.cs - About 1 hr to fix

      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)
      Severity: Minor
      Found in CustomerTestsExcel/ExcelTabularPage.cs - About 1 hr to fix

        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)
                      {

          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)
                  {
          Severity: Minor
          Found in CustomerTestsExcel/ExcelToCode/ExcelToCodeTable.cs - About 1 hr to fix

            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)
              Severity: Minor
              Found in CustomerTestsExcel/SpecificationBase.cs - About 1 hr to fix

                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;
                Severity: Minor
                Found in CustomerTestsExcel/ExcelTabularPage.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

                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>();
                Severity: Minor
                Found in CustomerTestsExcel/ExcelDateHelper.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

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

                        private void AddRow(Row row)
                        {
                            rowLookupCache = null;
                            rowLookupCacheAssociatedSheet = null;
                            rowLookupCacheEnumerator = null;
                Severity: Minor
                Found in CustomerTestsExcel/ExcelTabularPage.cs - About 1 hr to fix

                  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;
                  
                  
                  Severity: Minor
                  Found in CustomerTestsExcel/ExcelTabularPage.cs - About 1 hr to fix

                    Method SetPropertyOnTableRowVariable has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            void SetPropertyOnTableRowVariable(
                                Dictionary<uint, TableHeader> headers,
                                uint tableRow,
                                uint tableColumn)
                            {
                    Severity: Minor
                    Found in CustomerTestsExcel/ExcelToCode/ExcelToCodeTable.cs - About 1 hr to fix

                      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
                      Severity: Minor
                      Found in CustomerTestsExcel.Test/AddNavigationtToHTMLOutputTest.cs - About 1 hr to fix

                        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())
                          Severity: Minor
                          Found in CustomerTestsExcel/ExcelToCode/ExcelToCodeThen.cs - About 1 hr to fix

                            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");
                              Severity: Minor
                              Found in GenerateCodeFromExcelTest/Program.cs - About 1 hr to fix

                                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>();
                                Severity: Minor
                                Found in CustomerTestsExcel/ExcelTabularPage.cs - About 1 hr to fix

                                  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;
                                  
                                  
                                  Severity: Minor
                                  Found in CustomerTestsExcel/CodeNameToExcelNameConverter.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