hackedteam/core-android-market

View on GitHub
src/libbson/boost/boost_1_53_0/libs/math/dot_net_example/distribution_explorer/DistexForm.cs

Summary

Maintainability
F
6 days
Test Coverage

File DistexForm.cs has 542 lines of code (exceeds 250 allowed). Consider refactoring.
Open

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;

    Method saveFileDialog1_FileOk has 152 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private void saveFileDialog1_FileOk(object sender, CancelEventArgs e)
        {
          using (StreamWriter sw = new StreamWriter(this.saveFileDialog.FileName))
          { // Write distribution info and properties to file.
            sw.WriteLine( AssemblyDescription);

      Method tabPage2_Enter has 99 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private void tabPage2_Enter(object sender, EventArgs e)
          { // Properties tab shows distribution's mean, mode, median...
            try
            { // Show chosen distribution name, and parameter names & values.
              int i = distribution.SelectedIndex;

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

          public partial class DistexForm : Form
          {
        
            EventLog log = new EventLog();
            /// <summary>

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

              private void distribution_SelectedIndexChanged(object sender, EventArgs e)
              {
                int i = distribution.SelectedIndex; // distribution tab.
                parameter1Label.Text = boost_math.any_distribution.first_param_name(i);
                parameterLabel1.Text = boost_math.any_distribution.first_param_name(i); // properties tab.

            Method saveFileDialog1_FileOk has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring.
            Open

                private void saveFileDialog1_FileOk(object sender, CancelEventArgs e)
                {
                  using (StreamWriter sw = new StreamWriter(this.saveFileDialog.FileName))
                  { // Write distribution info and properties to file.
                    sw.WriteLine( AssemblyDescription);

            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 Form_Load has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private void Form_Load(object sender, EventArgs e)
                { // Load distribution & parameters names, and default values.
                  try
                  {
                    // Create and show splash screen:

              Method properties_tab_Deselecting has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private void properties_tab_Deselecting(object sender, TabControlCancelEventArgs e)
                  {
                    try
                    {
                      if (e.TabPageIndex == 0)

                Method QuantileTab_Enter has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private void QuantileTab_Enter(object sender, EventArgs e)
                    { // Evaluate critical values (quantiles) for pre-chosen risk level.
                      // and then, optionally, for other user-provided risk levels.
                      try
                      {

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

                          if (QuantileData.Rows.Count == 1)
                          {
                            // Add some defaults:
                            QuantileData.Rows.Add(5); // 5 Risk levels.
                            QuantileData.Rows[0].Cells[0].Value = "0.001"; // Risk values as text,
                  src/libbson/boost/boost_1_53_0/libs/math/dot_net_example/distribution_explorer/DistexForm.cs on lines 504..522

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

                  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 (QuantileData.Rows.Count == 1)
                          { // Add some defaults:
                            QuantileData.Rows.Add(5); // 5 Risk levels.
                            QuantileData.Rows[0].Cells[0].Value = "0.001"; // Risk values as text,
                            QuantileData.Rows[0].Cells[1].Value = dist.quantile(0.001); // & as double.
                  src/libbson/boost/boost_1_53_0/libs/math/dot_net_example/distribution_explorer/DistexForm.cs on lines 314..333

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

                  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

                            sw.WriteLine(QuantileData.Rows[r].Cells[0].Value.ToString() + separator +
                              QuantileData.Rows[r].Cells[1].Value.ToString() + separator +
                              QuantileData.Rows[r].Cells[2].Value.ToString());
                  src/libbson/boost/boost_1_53_0/libs/math/dot_net_example/distribution_explorer/DistexForm.cs on lines 534..536

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

                  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

                            sw.WriteLine(CDF_data.Rows[r].Cells[0].Value.ToString() + separator + // x value.
                              CDF_data.Rows[r].Cells[1].Value.ToString() + separator + // pdf
                              CDF_data.Rows[r].Cells[2].Value.ToString() + separator + // cdf
                  src/libbson/boost/boost_1_53_0/libs/math/dot_net_example/distribution_explorer/DistexForm.cs on lines 526..528

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

                  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 (boost_math.any_distribution.third_param_name(i).Length.CompareTo(0) != 0)
                        {
                          parameter3.Visible = true;
                          parameterLabel3.Visible = true;
                          parameter3ValueLabel.Visible = true;
                  src/libbson/boost/boost_1_53_0/libs/math/dot_net_example/distribution_explorer/DistexForm.cs on lines 94..106

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

                  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 (boost_math.any_distribution.second_param_name(i).Length.CompareTo(0) != 0)
                        {
                          parameter2.Visible = true;
                          parameterLabel2.Visible = true;
                          parameter2ValueLabel.Visible = true;
                  src/libbson/boost/boost_1_53_0/libs/math/dot_net_example/distribution_explorer/DistexForm.cs on lines 108..119

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

                  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 (boost_math.any_distribution.third_param_name(i).Length.CompareTo(0) != 0)
                          { // Is a 3rd parameter.
                            sw.WriteLine(parameterLabel3.Text + separator + this.parameter3.Text);
                          }
                  src/libbson/boost/boost_1_53_0/libs/math/dot_net_example/distribution_explorer/DistexForm.cs on lines 397..400

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

                  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 (boost_math.any_distribution.second_param_name(i).Length.CompareTo(0) != 0)
                          { // Is a 2nd parameter.
                            sw.WriteLine(parameterLabel2.Text + separator +  this.parameter2.Text);
                          }
                  src/libbson/boost/boost_1_53_0/libs/math/dot_net_example/distribution_explorer/DistexForm.cs on lines 401..404

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

                  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

                  There are no issues that match your filters.

                  Category
                  Status