philipbelesky/Caribou

View on GitHub

Showing 82 of 82 total issues

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

        public static GH_Structure<GH_Brep> MakeTreeForBuildings(Dictionary<OSMTag, List<Brep>> foundBuildings)
        {
            var output = new GH_Structure<GH_Brep>();
            var i = 0;

Severity: Major
Found in Caribou/Models/TreeFormatters.cs and 2 other locations - About 2 hrs to fix
Caribou/Models/TreeFormatters.cs on lines 79..97
Caribou/Models/TreeFormatters.cs on lines 99..117

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

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 3 locations. Consider refactoring.
Open

        public static GH_Structure<GH_Curve> MakeTreeForWays(Dictionary<OSMTag, List<PolylineCurve>> foundWays)
        {
            var output = new GH_Structure<GH_Curve>();
            var i = 0;

Severity: Major
Found in Caribou/Models/TreeFormatters.cs and 2 other locations - About 2 hrs to fix
Caribou/Models/TreeFormatters.cs on lines 79..97
Caribou/Models/TreeFormatters.cs on lines 119..136

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

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 3 locations. Consider refactoring.
Open

        public static GH_Structure<GH_Point> MakeTreeForNodes(Dictionary<OSMTag, List<Point3d>> foundNodes)
        {
            var output = new GH_Structure<GH_Point>();
            var i = 0;

Severity: Major
Found in Caribou/Models/TreeFormatters.cs and 2 other locations - About 2 hrs to fix
Caribou/Models/TreeFormatters.cs on lines 99..117
Caribou/Models/TreeFormatters.cs on lines 119..136

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

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

        public static void FindWaysInXML(XmlReader reader, ref RequestHandler request, int fileIndex, bool onlyBuildings)
        {
            string currentWayId = "";
            var currentWayMetaData = new Dictionary<string, string>();
            var currentWayNodes = new List<Coord>();
Severity: Major
Found in Caribou/Processing/ParseViaXMLReader.cs - About 2 hrs to fix

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

            public static Dictionary<OSMTag, List<Brep>> BuildingBrepsFromCoords(ref RequestHandler result, bool outputHeighted)
            {
                var geometryResult = new Dictionary<OSMTag, List<Brep>>();
                var unitScale = RhinoMath.UnitScale(UnitSystem.Meters, RhinoDoc.ActiveDoc.ModelUnitSystem); // OSM conversion assumes meters
                var tolerance = RhinoDoc.ActiveDoc.ModelAbsoluteTolerance; 
    Severity: Minor
    Found in Caribou/Processing/TranslateToXYManually.cs - About 2 hrs to fix

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

              protected override void CaribouSolveInstance(IGH_DataAccess da)
              {
                  if (this.state == 0)
                  {
                      if (this.BaseWorker == null)
      Severity: Minor
      Found in Caribou/CaribouAsyncComponent.cs - About 1 hr to fix

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

                        {
                            var item = OSMPrimaryTypes.Values[rawKeyValue];
                            name = textInfo.ToTitleCase(item["value"]);
                            explanation = item["description"];
                            NodeCount = int.Parse(item["nodes"]);
        Severity: Major
        Found in Caribou/Models/OSMTag.cs and 1 other location - About 1 hr to fix
        Caribou/Models/OSMTag.cs on lines 87..95

        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 2 locations. Consider refactoring.
        Open

                        {
                            var item = OSMArbitraryTypes.Values[rawKeyValue];
                            name = textInfo.ToTitleCase(item["value"]);
                            explanation = item["description"];
                            NodeCount = int.Parse(item["nodes"]);
        Severity: Major
        Found in Caribou/Models/OSMTag.cs and 1 other location - About 1 hr to fix
        Caribou/Models/OSMTag.cs on lines 77..85

        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

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

                protected TreeGridItemCollection GetSelectableTagsFromInputTree(OSMListWithPaths requests)
                {
                    var indexOfParents = new Dictionary<string, int>();
                    var sortedTags = requests.items.OrderBy(t => t.ToString()).ToList();
                    var selectableTags = new TreeGridItemCollection();
        Severity: Minor
        Found in Caribou/Components/PickTagsComponent.cs - About 1 hr to fix

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

          namespace Caribou.Components
          {
              using System;
              using Caribou.Properties;
              using Caribou.Workers;
          Severity: Major
          Found in Caribou/Components/FindNodesComponent.cs and 1 other location - About 1 hr to fix
          Caribou/Components/FindWaysComponent.cs on lines 1..28

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

          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

          namespace Caribou.Components
          {
              using System;
              using Caribou.Properties;
              using Caribou.Workers;
          Severity: Major
          Found in Caribou/Components/FindWaysComponent.cs and 1 other location - About 1 hr to fix
          Caribou/Components/FindNodesComponent.cs on lines 1..28

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

          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 3 locations. Consider refactoring.
          Open

                  [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
                  internal static global::System.Resources.ResourceManager ResourceManager {
                      get {
                          if (object.ReferenceEquals(resourceMan, null)) {
                              global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Caribou.Profiling.Properties.Resources", typeof(Resources).Assembly);
          Severity: Major
          Found in Caribou.Profiling/Properties/Resources.Designer.cs and 2 other locations - About 1 hr to fix
          Caribou.Tests/Properties/Resources.Designer.cs on lines 38..47
          Caribou/Properties/Resources.Designer.cs on lines 38..47

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

          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 3 locations. Consider refactoring.
          Open

                  [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
                  internal static global::System.Resources.ResourceManager ResourceManager {
                      get {
                          if (object.ReferenceEquals(resourceMan, null)) {
                              global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Caribou.Tests.Properties.Resources", typeof(Resources).Assembly);
          Severity: Major
          Found in Caribou.Tests/Properties/Resources.Designer.cs and 2 other locations - About 1 hr to fix
          Caribou.Profiling/Properties/Resources.Designer.cs on lines 38..47
          Caribou/Properties/Resources.Designer.cs on lines 38..47

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

          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 3 locations. Consider refactoring.
          Open

                  [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
                  internal static global::System.Resources.ResourceManager ResourceManager {
                      get {
                          if (object.ReferenceEquals(resourceMan, null)) {
                              global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Caribou.Properties.Resources", typeof(Resources).Assembly);
          Severity: Major
          Found in Caribou/Properties/Resources.Designer.cs and 2 other locations - About 1 hr to fix
          Caribou.Profiling/Properties/Resources.Designer.cs on lines 38..47
          Caribou.Tests/Properties/Resources.Designer.cs on lines 38..47

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

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

                  public static void FindNodesInXML(XmlReader reader, ref RequestHandler request, int fileIndex, bool onlyBuildings)
                  {
                      string currentNodeId = "";
                      double currentLat = 0;
                      double currentLon = 0;
          Severity: Minor
          Found in Caribou/Processing/ParseViaXMLReader.cs - About 1 hr to fix

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

                    private static Dictionary<string, OSMTag> GetKeys()
                    {
                        return new Dictionary<string, OSMTag>()
                        {
                            { "aerialway",  new OSMTag("aerialway", "Aerialway", "Forms of transportation for people or goods that use aerial wires, e.g. cable-cars & chair-lifts.") },
            Severity: Minor
            Found in Caribou/Models/OSMPrimaryTypes.cs - About 1 hr to fix

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

                      public static void GetBounds(ref RequestHandler result, bool readPathAsContents = false)
                      {
                          double? currentMinLat = null;
                          double? currentMinLon = null;
                          double? currentMaxLat = null;
              Severity: Minor
              Found in Caribou/Processing/ParseViaXMLReader.cs - About 1 hr to fix

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

                        public static GH_Structure<GH_String> MakeReportForRequests(
                            Dictionary<OSMTag, int> foundItemsForResult)
                        {
                            var output = new GH_Structure<GH_String>();
                            var tInfo = CultureInfo.CurrentCulture.TextInfo;
                Severity: Minor
                Found in Caribou/Models/TreeFormatters.cs - About 1 hr to fix

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

                          void _OnFormatCell(object sender, GridCellFormatEventArgs e)
                          {
                              switch (e.Column.HeaderText)
                              {
                                  case TagTypeLabel:
                  Severity: Minor
                  Found in Caribou/Forms/UI/TableStrip.cs - About 1 hr to fix

                    Method SetData has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            public void SetData(IGH_DataAccess da)
                            {
                                try
                                {
                                    WorkerSetData(da); // Worker must implement a custom SetData as per below
                    Severity: Minor
                    Found in Caribou/WorkerInstance.cs - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language