Badgerati/NotifyMeCI

View on GitHub

Showing 50 of 50 total issues

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

        public override IList<CIJob> GetJobs(CIServer server)
        {
            var _jobs = default(IList<CIJob>);

            // if not server return null
Severity: Major
Found in NotifyMeCI.Engine/Servers/AppVeyorCIServer.cs and 1 other location - About 1 hr to fix
NotifyMeCI.Engine/Servers/TravisCIServer.cs on lines 26..51

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 113.

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

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

        public override IList<CIJob> GetJobs(CIServer server)
        {
            var _jobs = default(IList<CIJob>);

            // if not server return null
Severity: Major
Found in NotifyMeCI.Engine/Servers/TravisCIServer.cs and 1 other location - About 1 hr to fix
NotifyMeCI.Engine/Servers/AppVeyorCIServer.cs on lines 26..51

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 113.

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

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

                private BuildStatusType MapBuildStatus(string status)
                {
                    if (string.IsNullOrWhiteSpace(status))
                    {
                        return BuildStatusType.Unknown;
        Severity: Major
        Found in NotifyMeCI.Engine/Servers/TravisCIServer.cs and 1 other location - About 1 hr to fix
        NotifyMeCI.Engine/Servers/AppVeyorCIServer.cs on lines 152..179

        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 102.

        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

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

                private BuildStatusType MapBuildStatus(string status)
                {
                    if (string.IsNullOrWhiteSpace(status))
                    {
                        return BuildStatusType.Unknown;
        Severity: Major
        Found in NotifyMeCI.Engine/Servers/AppVeyorCIServer.cs and 1 other location - About 1 hr to fix
        NotifyMeCI.Engine/Servers/TravisCIServer.cs on lines 166..193

        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 102.

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

              Method ValidateServerValues has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      public static string ValidateServerValues(string serverType, string name, string url, int poll, string apiToken, bool uniqueName = true)
              Severity: Minor
              Found in NotifyMeCI.GUI/Validator.cs - About 45 mins to fix

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

                        protected int GetInt(object value)
                        {
                            if (value == default(object))
                            {
                                return 0;
                Severity: Minor
                Found in NotifyMeCI.Engine/Servers/BaseCIServer.cs and 1 other location - About 40 mins to fix
                NotifyMeCI.Engine/Servers/BaseCIServer.cs on lines 89..99

                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 70.

                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

                        protected long GetLong(object value)
                        {
                            if (value == default(object))
                            {
                                return 0;
                Severity: Minor
                Found in NotifyMeCI.Engine/Servers/BaseCIServer.cs and 1 other location - About 40 mins to fix
                NotifyMeCI.Engine/Servers/BaseCIServer.cs on lines 55..65

                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 70.

                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

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

                            if (!string.IsNullOrWhiteSpace(token))
                            {
                                request.PreAuthenticate = true;
                                request.Headers.Add(HttpRequestHeader.Authorization, string.Format("Basic {0}", GetBase64String(token)));
                            }
                Severity: Minor
                Found in NotifyMeCI.Engine/Servers/JenkinsCIServer.cs and 1 other location - About 40 mins to fix
                NotifyMeCI.Engine/Servers/JenkinsCIServer.cs on lines 74..78

                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 68.

                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

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

                                if (!string.IsNullOrWhiteSpace(token))
                                {
                                    request.PreAuthenticate = true;
                                    request.Headers.Add(HttpRequestHeader.Authorization, string.Format("Basic {0}", GetBase64String(token)));
                                }
                Severity: Minor
                Found in NotifyMeCI.Engine/Servers/JenkinsCIServer.cs and 1 other location - About 40 mins to fix
                NotifyMeCI.Engine/Servers/JenkinsCIServer.cs on lines 234..238

                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 68.

                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 ValidateServerValues has a Cognitive Complexity of 22 (exceeds 20 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 35 mins 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

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

                            this.JobListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
                            this.JobList_BuildIdColumn,
                            this.JobList_JobNameColumn,
                            this.JobList_ServerNameColumn,
                            this.JobList_TimeStampColumn,
                Severity: Minor
                Found in NotifyMeCI.GUI/Form1.Designer.cs and 1 other location - About 30 mins to fix
                NotifyMeCI.GUI/Form1.Designer.cs on lines 341..347

                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 61.

                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

                            this.ServerListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
                            this.ServerList_NameColumn,
                            this.ServerList_TypeColumn,
                            this.ServerList_UrlColumn,
                            this.ServerList_PollColumn,
                Severity: Minor
                Found in NotifyMeCI.GUI/Form1.Designer.cs and 1 other location - About 30 mins to fix
                NotifyMeCI.GUI/Form1.Designer.cs on lines 128..134

                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 61.

                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

                Avoid too many return statements within this method.
                Open

                                            return string.Format("Invalid API Token supplied: '{0}'", apiToken);
                Severity: Major
                Found in NotifyMeCI.GUI/Validator.cs - About 30 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language