elv1s42/NUnitGo

View on GitHub

Showing 58 of 58 total issues

Class HtmlTextWriterExtensions has 66 methods (exceeds 20 allowed). Consider refactoring.
Open

    public static class HtmlTextWriterExtensions
    {
        public static void AddTag(this HtmlTextWriter writer, HtmlTextWriterTag tag,
            Dictionary<string, string> attributes, string value = "")
        {
Severity: Major
Found in NunitGoCore/Extensions/HtmlTextWriterExtensions.cs - About 1 day to fix

    Method SendEmails has a Cognitive Complexity of 63 (exceeds 20 allowed). Consider refactoring.
    Open

            private void SendEmails(bool isSuccess)
            {
                try
                {
                    if (!_configuration.SendEmails) return;
    Severity: Minor
    Found in NunitGoCore/Attributes/NunitGoActionAttribute.cs - About 7 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

    File HtmlTextWriterExtensions.cs has 412 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    using System;
    using System.Collections.Generic;
    using System.Web.UI;
    
    namespace NUnitGoCore.Extensions
    Severity: Minor
    Found in NunitGoCore/Extensions/HtmlTextWriterExtensions.cs - About 5 hrs to fix

      File NunitGoActionAttribute.cs has 402 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      using System;
      using System.Collections.Generic;
      using System.IO;
      using System.Linq;
      using System.Reflection;
      Severity: Minor
      Found in NunitGoCore/Attributes/NunitGoActionAttribute.cs - About 5 hrs to fix

        Method GetMailBody has 137 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public static string GetMailBody(NunitGoTest nunitGoTest, bool addLinks, 
                    bool isEventEmail = false, string eventName = "", TestEvent previousRunEvent = null)
                {
                    var strWr = new StringWriter();
                    using (var writer = new HtmlTextWriter(strWr))
        Severity: Major
        Found in NunitGoCore/NunitGoItems/Subscriptions/MailGenerator.cs - About 5 hrs to fix

          Method SendEmails has 92 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  private void SendEmails(bool isSuccess)
                  {
                      try
                      {
                          if (!_configuration.SendEmails) return;
          Severity: Major
          Found in NunitGoCore/Attributes/NunitGoActionAttribute.cs - About 3 hrs to fix

            Method GetStyle has 92 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    public static string GetStyle()
                    {
                        var testCssSet = new CssSet("testcase-element");
                        testCssSet.AddElement(new CssElement("#" + Id)
                        {
            Severity: Major
            Found in NunitGoCore/CustomElements/NunitTestHtml/NunitTestHtml.cs - About 3 hrs to fix

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                                      if (subscription != null)
                                      {
                                          EmailHelper.Send(_configuration.SendFromList, subscription.TargetEmails,
                                              _nunitGoTest, _screenshotsPath, _configuration.AddLinksInsideEmail,
                                              true, sub.EventName, previuosEvent);
              Severity: Major
              Found in NunitGoCore/Attributes/NunitGoActionAttribute.cs and 1 other location - About 2 hrs to fix
              NunitGoCore/Attributes/NunitGoActionAttribute.cs on lines 308..326

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 198.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                                          if (subscription != null)
                                          {
                                              EmailHelper.Send(_configuration.SendFromList, subscription.TargetEmails,
                                                  _nunitGoTest, _screenshotsPath, _configuration.AddLinksInsideEmail,
                                                  true, sub.EventName, previuosEvent);
              Severity: Major
              Found in NunitGoCore/Attributes/NunitGoActionAttribute.cs and 1 other location - About 2 hrs to fix
              NunitGoCore/Attributes/NunitGoActionAttribute.cs on lines 257..275

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 198.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Method BuildTreeFromSuites has 50 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      private static void BuildTreeFromSuites(this HtmlTextWriter writer, IEnumerable<NunitGoSuite> suites)
                      {
                          foreach (var suite in suites)
                          {
                              var tests = suite.Tests;
              Severity: Minor
              Found in NunitGoCore/CustomElements/HtmlCustomElements/Tree.cs - About 2 hrs to fix

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

                        private void SendEmailsForEvents()
                        {
                            try
                            {
                                if (!_configuration.SendEmails) return;
                Severity: Minor
                Found in NunitGoCore/Attributes/NunitGoActionAttribute.cs - About 1 hr to fix

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

                          public static string GetStyle()
                          {
                              var tooltipCssSet = new CssSet("tooltip-style");
                              tooltipCssSet.AddElement(new CssElement(".tooltip")
                              {
                  Severity: Minor
                  Found in NunitGoCore/CustomElements/HtmlCustomElements/Tooltip.cs - About 1 hr to fix

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                                {
                                    writer.RenderBeginTag(HtmlTextWriterTag.P);
                                    writer.AddTag(HtmlTextWriterTag.B, "Message: ");
                                    writer.Write(NunitTestHtml.GenerateTxtView(nunitGoTest.TestMessage));
                                    writer.RenderEndTag(); //P
                    NunitGoCore/NunitGoItems/Subscriptions/MailGenerator.cs on lines 166..175

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 142.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                                    {
                                        writer.RenderBeginTag(HtmlTextWriterTag.P);
                                        writer.AddTag(HtmlTextWriterTag.B, "Stack trace: ");
                                        writer.Write(NunitTestHtml.GenerateTxtView(nunitGoTest.TestStackTrace));
                                        writer.RenderEndTag(); //P
                    Severity: Major
                    Found in NunitGoCore/NunitGoItems/Subscriptions/MailGenerator.cs and 1 other location - About 1 hr to fix
                    NunitGoCore/CustomElements/NunitTestHtml/NunitTestHtmlSections/FailureSection.cs on lines 15..24

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 142.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Method GeneratePageString has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            private void GeneratePageString()
                            {
                                var strWr = new StringWriter();
                                using (var writer = new HtmlTextWriter(strWr))
                                {
                    Severity: Minor
                    Found in NunitGoCore/CustomElements/HtmlPage.cs - About 1 hr to fix

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                              {
                                  try
                                  {
                                      var reportMenuTitle = new SectionName("Tests timeline");
                                      var timeline = new TimelineSection(tests);
                      Severity: Major
                      Found in NunitGoCore/CustomElements/PageGenerator.cs and 1 other location - About 1 hr to fix
                      NunitGoCore/CustomElements/PageGenerator.cs on lines 57..77

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 134.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                              {
                                  try
                                  {
                                      var reportMenuTitle = new SectionName("Main statistics");
                                      var statisticsSection = new StatisticsSection(stats);
                      Severity: Major
                      Found in NunitGoCore/CustomElements/PageGenerator.cs and 1 other location - About 1 hr to fix
                      NunitGoCore/CustomElements/PageGenerator.cs on lines 104..124

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 134.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 4 locations. Consider refactoring.
                      Open

                      using System.Reflection;
                      using System.Runtime.InteropServices;
                      
                      // General Information about an assembly is controlled through the following 
                      // set of attributes. Change these attribute values to modify the information
                      Severity: Major
                      Found in NunitGoCore/Properties/AssemblyInfo.cs and 3 other locations - About 1 hr to fix
                      NunitGoReport/Properties/AssemblyInfo.cs on lines 1..36
                      NunitTestsExample/Properties/AssemblyInfo.cs on lines 1..36
                      NunitTestsExample2/Properties/AssemblyInfo.cs on lines 1..36

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 133.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 4 locations. Consider refactoring.
                      Open

                      using System.Reflection;
                      using System.Runtime.InteropServices;
                      
                      // General Information about an assembly is controlled through the following 
                      // set of attributes. Change these attribute values to modify the information
                      Severity: Major
                      Found in NunitTestsExample2/Properties/AssemblyInfo.cs and 3 other locations - About 1 hr to fix
                      NunitGoCore/Properties/AssemblyInfo.cs on lines 1..36
                      NunitGoReport/Properties/AssemblyInfo.cs on lines 1..36
                      NunitTestsExample/Properties/AssemblyInfo.cs on lines 1..36

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 133.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 4 locations. Consider refactoring.
                      Open

                      using System.Reflection;
                      using System.Runtime.InteropServices;
                      
                      // General Information about an assembly is controlled through the following 
                      // set of attributes. Change these attribute values to modify the information
                      Severity: Major
                      Found in NunitGoReport/Properties/AssemblyInfo.cs and 3 other locations - About 1 hr to fix
                      NunitGoCore/Properties/AssemblyInfo.cs on lines 1..36
                      NunitTestsExample/Properties/AssemblyInfo.cs on lines 1..36
                      NunitTestsExample2/Properties/AssemblyInfo.cs on lines 1..36

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 133.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Severity
                      Category
                      Status
                      Source
                      Language