Badgerati/Edison

View on GitHub

Showing 71 of 215 total issues

Class ReflectionRepository has 21 methods (exceeds 20 allowed). Consider refactoring.
Open

    [InjectionInterface(typeof(IReflectionRepository))]
    public class ReflectionRepository : IReflectionRepository
    {

        #region Constants
Severity: Minor
Found in Edison.Engine/Repositories/ReflectionRepository.cs - About 2 hrs to fix

    Class IReflectionRepository has 21 methods (exceeds 20 allowed). Consider refactoring.
    Open

        public interface IReflectionRepository
        {
    
            IEnumerable<string> GetSuites(Type type);
    
    
    Severity: Minor
    Found in Edison.Engine/Repositories/Interfaces/IReflectionRepository.cs - About 2 hrs to fix

      Class Logger has 21 methods (exceeds 20 allowed). Consider refactoring.
      Open

          public class Logger
          {
      
              #region Repositories
      
      
      Severity: Minor
      Found in Edison.Engine/Utilities/Logger.cs - About 2 hrs to fix

        Method Main has 49 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public static int Main(string[] args)
                {
                    // hook up the event to unload repos on app exit
                    AppDomainRepository.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit;
        
        
        Severity: Minor
        Found in Edison.Console/Program.cs - About 1 hr to fix

          Method RunTestFixtureCases has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring.
          Open

                  private void RunTestFixtureCases(Type testFixture, IEnumerable<TestCaseAttribute> cases, int testFixtureRepeat, IEnumerable<MethodInfo> fixtureSetup, IEnumerable<MethodInfo> fixtureTeardown)
                  {
                      var activator = default(object);
                      var setupDone = false;
                      var testDone = false;
          Severity: Minor
          Found in Edison.Engine/Threading/TestFixtureThread.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 Validate has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  public void Validate(EdisonContext context)
                  {
                      // need to validate a solution first, for its assemblies
                      SolutionValidator(context);
          
          
          Severity: Minor
          Found in Edison.Engine/Validators/AssemblyValidator.cs - About 1 hr to fix

            Method RunTests has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    private void RunTests(Type testFixture, int testFixtureRepeat, TestCaseAttribute testFixtureCase, object activator)
                    {
                        var tests = ReflectionRepository.GetMethods<TestAttribute>(testFixture, Context.IncludedCategories, Context.ExcludedCategories, Context.Tests).ToList();
                        var singularTests = default(List<MethodInfo>);
            
            
            Severity: Minor
            Found in Edison.Engine/Threading/TestFixtureThread.cs - About 1 hr to fix

              Method Run has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      public TestResultDictionary Run()
                      {
                          //run validation first
                          Validate();
              
              
              Severity: Minor
              Found in Edison.Engine/Contexts/EdisonContext.cs - About 1 hr to fix

                Method CheckExpectedException has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        private bool CheckExpectedException(MethodInfo testMethod, bool isAssertFail, Exception innerException)
                        {
                            var expectedException = ReflectionRepository.GetExpectedException(testMethod);
                
                            if (expectedException == default(ExpectedExceptionAttribute)
                Severity: Minor
                Found in Edison.Engine/Threading/TestThread.cs - About 1 hr to fix

                  Method InjectPropertyYamlValues has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          public static void InjectPropertyYamlValues(this object obj, Dictionary<object, object> yaml)
                          {
                              var keys = yaml.Keys.ToList();
                              var props = obj.GetType().GetProperties();
                  
                  
                  Severity: Minor
                  Found in Edison.Engine/Utilities/Extensions/ObjectExtension.cs - About 1 hr to fix

                    Method GetTestCount has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            public int GetTestCount(
                                Assembly assembly,
                                IList<string> includedCategories,
                                IList<string> excludedCategories,
                                IList<string> fixtures,
                    Severity: Minor
                    Found in Edison.Engine/Repositories/AssemblyRepository.cs - About 1 hr to fix

                      Method AddOrUpdate has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              public bool AddOrUpdate(TestResult result)
                              {
                                  var response = false;
                                  var _result = default(TestResult);
                                  var key = result.Assembly + "." + result.FullName;
                      Severity: Minor
                      Found in Edison.Engine/Utilities/Structures/TestResultDictionary.cs - About 1 hr to fix

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

                                public bool HasValidCategories(MemberInfo member, IList<string> includedCategories, IList<string> excludedCategories, bool testFixtureDefault = true)
                                {
                                    // if no categories are passed, just return true
                                    if (EnumerableHelper.IsNullOrEmpty(includedCategories) && EnumerableHelper.IsNullOrEmpty(excludedCategories))
                                    {
                        Severity: Minor
                        Found in Edison.Engine/Repositories/ReflectionRepository.cs - About 1 hr to fix

                          Method Run has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  public void Run()
                                  {
                                      while (!(_interrupted && Count == 0))
                                      {
                                          // if there's nothing to send, sleep for a little
                          Severity: Minor
                          Found in Edison.Engine/Threading/ResultCalloutThread.cs - About 1 hr to fix

                            Method Get has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    public dynamic Get(HtmlIdentifierType identifierType, string identifier)
                                    {
                                        if (Explorer.Document == null)
                                        {
                                            throw new NullReferenceException("Browser object has no Document available for querying");
                            Severity: Minor
                            Found in Edison.Framework/Browsers/Browser.cs - About 1 hr to fix

                              Method SolutionValidator has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      private void SolutionValidator(EdisonContext context)
                                      {
                                          // solution is optional, so if not passed skip validation
                                          if (string.IsNullOrWhiteSpace(context.Solution))
                                          {
                              Severity: Minor
                              Found in Edison.Engine/Validators/AssemblyValidator.cs - About 1 hr to fix

                                Method GetParameters has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        private string GetParameters(object[] parameters)
                                        {
                                            var _parameters = new StringBuilder();
                                
                                            // If there are no parameters, just return empty
                                Severity: Minor
                                Found in Edison.Framework/Results/TestResult.cs - About 1 hr to fix

                                  Method EdisonContext_OnTestResult has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          private void EdisonContext_OnTestResult(ETestResult result)
                                          {
                                              switch (result.AbsoluteState)
                                              {
                                                  case TestResultAbsoluteState.Ignored:
                                  Severity: Minor
                                  Found in Edison.TestDriven/TestRunner.cs - About 1 hr to fix

                                    Method SetProgress has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            private void SetProgress(int progress)
                                            {
                                                if (TestProgressBar.IsDisposed)
                                                {
                                                    return;
                                    Severity: Minor
                                    Found in Edison.GUI/Form1.cs - About 1 hr to fix

                                      Method WriteResultsToFile has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              private void WriteResultsToFile()
                                              {
                                                  if (DisableFileOutput)
                                                  {
                                                      Logger.Instance.WriteMessage("Output file creation disabled");
                                      Severity: Minor
                                      Found in Edison.Engine/Contexts/EdisonContext.cs - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language