Badgerati/NotifyMeCI

View on GitHub

Showing 27 of 50 total issues

Method InitializeComponent has 281 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
            this.menuStrip1 = new System.Windows.Forms.MenuStrip();
Severity: Major
Found in NotifyMeCI.GUI/Form1.Designer.cs - About 1 day to fix

    Method InitializeComponent has 161 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            private void InitializeComponent()
            {
                System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EditServerForm));
                this.label1 = new System.Windows.Forms.Label();
                this.ServerTypeDdl = new System.Windows.Forms.ComboBox();
    Severity: Major
    Found in NotifyMeCI.GUI/EditServerForm.Designer.cs - About 6 hrs to fix

      File Form1.cs has 401 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      using NotifyMeCI.Engine.Enums;
      using NotifyMeCI.Engine.Events;
      using NotifyMeCI.Engine.Repositories.Interfaces;
      using NotifyMeCI.Engine.Objects;
      using NotifyMeCI.Injector;
      Severity: Minor
      Found in NotifyMeCI.GUI/Form1.cs - About 5 hrs to fix

        File Form1.Designer.cs has 333 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        namespace NotifyMeCI.GUI
        {
            partial class Form1
            {
                /// <summary>
        Severity: Minor
        Found in NotifyMeCI.GUI/Form1.Designer.cs - About 4 hrs to fix

          Method InitializeComponent has 78 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  private void InitializeComponent()
                  {
                      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SettingsForm));
                      this.CancelBtn = new System.Windows.Forms.Button();
                      this.OkBtn = new System.Windows.Forms.Button();
          Severity: Major
          Found in NotifyMeCI.GUI/SettingsForm.Designer.cs - About 3 hrs to fix

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

                public partial class Form1 : Form
                {
            
                    #region Repositories
            
            
            Severity: Minor
            Found in NotifyMeCI.GUI/Form1.cs - About 2 hrs to fix

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

                      public static string ValidateServerValues(string serverType, string name, string url, int poll, string apiToken, bool uniqueName = true)
                      {
                          try
                          {
                              // check server type
              Severity: Minor
              Found in NotifyMeCI.GUI/Validator.cs - About 2 hrs to fix

                Method UpdateJobsList has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        private void UpdateJobsList(IList<CIJob> jobs)
                        {
                            if (jobs == default(IList<CIJob>) || !jobs.Any())
                            {
                                return;
                Severity: Minor
                Found in NotifyMeCI.GUI/Form1.cs - About 1 hr to fix

                  Method UpdateJobGui has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          private void UpdateJobGui(IList<CIJob> jobs)
                          {
                              // Clear the current jobs list
                              if (JobListView.InvokeRequired)
                              {
                  Severity: Minor
                  Found in NotifyMeCI.GUI/Form1.cs - About 1 hr to fix

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

                            private void AddServerBtn_Click(object sender, EventArgs e)
                            {
                                var errorTitle = "Error Adding New Server";
                    
                                try
                    Severity: Minor
                    Found in NotifyMeCI.GUI/Form1.cs - About 1 hr to fix

                      Method CoreLogic has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              public void CoreLogic()
                              {
                                  // get all the servers that need updating
                                  var servers = IsFirstRun
                                      ? CIServerRepository.All()
                      Severity: Minor
                      Found in NotifyMeCI.Engine/Tasks/JobTask.cs - About 1 hr to fix

                        Method SetupBuildStatusTable has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                private void SetupBuildStatusTable()
                                {
                                    // get all status enum values
                                    var statuses = Enum.GetNames(typeof(BuildStatusType));
                                    var rows = statuses.Length + 1;
                        Severity: Minor
                        Found in NotifyMeCI.GUI/SettingsForm.cs - About 1 hr to fix

                          Method UpdateJob has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  private CIJob UpdateJob(CIJob job, string token)
                                  {
                                      if (job == default(CIJob))
                                      {
                                          return job;
                          Severity: Minor
                          Found in NotifyMeCI.Engine/Servers/JenkinsCIServer.cs - About 1 hr to fix

                            Method UpdateBtn_Click has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    private void UpdateBtn_Click(object sender, EventArgs e)
                                    {
                                        var errorTitle = "Error Updating Server";
                            
                                        try
                            Severity: Minor
                            Found in NotifyMeCI.GUI/EditServerForm.cs - About 1 hr to fix

                              Method ServerTypeDdl_SelectedIndexChanged has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      private void ServerTypeDdl_SelectedIndexChanged(object sender, EventArgs e)
                                      {
                                          var serverType = default(CIServerType);
                              
                                          var selectedItem = ServerTypeDdl.SelectedItem;
                              Severity: Minor
                              Found in NotifyMeCI.GUI/Form1.cs - About 1 hr to fix

                                Method SaveBuildStatuses has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        private void SaveBuildStatuses()
                                        {
                                            var statuses = new List<BuildStatus>(BuildStatusTable.RowCount - 1);
                                
                                            for (var r = 1; r < BuildStatusTable.RowCount; r++)
                                Severity: Minor
                                Found in NotifyMeCI.GUI/SettingsForm.cs - About 1 hr to fix

                                  Method UpdateJobsList has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
                                  Open

                                          private void UpdateJobsList(IList<CIJob> jobs)
                                          {
                                              if (jobs == default(IList<CIJob>) || !jobs.Any())
                                              {
                                                  return;
                                  Severity: Minor
                                  Found in NotifyMeCI.GUI/Form1.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 InitialiseJob has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          private CIJob InitialiseJob(JToken projectJson, CIServer server)
                                          {
                                              if (!GetBool(projectJson["active"]))
                                              {
                                                  return default(CIJob);
                                  Severity: Minor
                                  Found in NotifyMeCI.Engine/Servers/TravisCIServer.cs - About 1 hr to fix

                                    Method MapBuildStatus has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            private BuildStatusType MapBuildStatus(string status)
                                            {
                                                if (string.IsNullOrWhiteSpace(status))
                                                {
                                                    return BuildStatusType.Unknown;
                                    Severity: Minor
                                    Found in NotifyMeCI.Engine/Servers/JenkinsCIServer.cs - About 1 hr to fix

                                      Method MapColor has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              public static Color MapColor(this IDictionary<BuildStatusType, BuildStatus> src, BuildStatusType statusType)
                                              {
                                                  if (src.ContainsKey(statusType) && src[statusType].ColorA != 0)
                                                  {
                                                      var status = src[statusType];
                                      Severity: Minor
                                      Found in NotifyMeCI.Engine/Objects/BuildStatus.cs - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language