philipbelesky/Caribou

View on GitHub

Showing 82 of 82 total issues

Method GetTagsCaseData has 141 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        public static List<List<List<string>>> GetTagsCaseData()
        {
            var branch0 = new List<List<string>>() { };
            var branch1 = new List<List<string>>() { };

Severity: Major
Found in Caribou.Tests/Cases/TagsTestClases.cs - About 5 hrs to fix

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

    namespace Caribou.Tests.Parsing
    {
        using Caribou.Models;
        using Caribou.Tests.Cases;
        using Microsoft.VisualStudio.TestTools.UnitTesting;
    Severity: Major
    Found in Caribou.Tests/Parsing/TestWayParsingMultiple.cs and 1 other location - About 4 hrs to fix
    Caribou.Tests/Parsing/TestNodeParsingMultiple.cs on lines 1..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 312.

    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.Tests.Parsing
    {
        using Caribou.Models;
        using Caribou.Tests.Cases;
        using Microsoft.VisualStudio.TestTools.UnitTesting;
    Severity: Major
    Found in Caribou.Tests/Parsing/TestNodeParsingMultiple.cs and 1 other location - About 4 hrs to fix
    Caribou.Tests/Parsing/TestWayParsingMultiple.cs on lines 1..94

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

    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

            [TestMethod]
            public void ParseNodesGivenDoubleKeyViaXMLReader()
            {
                var queryA = new OSMTag("addr:street", "Swanston Street");
                var test = new ParseRequest(new List<OSMTag>() { queryA });
    Severity: Major
    Found in Caribou.Tests/Parsing/TestNodeParsingSimple.cs and 1 other location - About 4 hrs to fix
    Caribou.Tests/Parsing/TestWayParsingSimple.cs on lines 94..111

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

    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

            [TestMethod]
            public void ParseWaysGivenDoubleKeyViaXMLReader()
            {
                var queryA = new OSMTag("addr:street", "Swanston Street");
                var test = new ParseRequest(new List<OSMTag>() { queryA });
    Severity: Major
    Found in Caribou.Tests/Parsing/TestWayParsingSimple.cs and 1 other location - About 4 hrs to fix
    Caribou.Tests/Parsing/TestNodeParsingSimple.cs on lines 84..101

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

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

            protected override void CaribouSolveInstance(IGH_DataAccess da)
            {
                logger.Reset();
    
                #region Input Parsing
    Severity: Major
    Found in Caribou/Components/PickTagsComponent.cs - About 3 hrs to fix

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

      namespace Caribou.Workers
      {
          using System;
          using System.Collections.Generic;
          using Caribou.Components;
      Severity: Major
      Found in Caribou/Workers/ParseWaysWorker.cs and 1 other location - About 3 hrs to fix
      Caribou/Workers/ParseNodesWorker.cs on lines 1..52

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

      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.Workers
      {
          using System;
          using System.Collections.Generic;
          using Caribou.Components;
      Severity: Major
      Found in Caribou/Workers/ParseNodesWorker.cs and 1 other location - About 3 hrs to fix
      Caribou/Workers/ParseWaysWorker.cs on lines 1..52

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

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

              private TreeGridView GetLayout(TreeGridItemCollection selectableItems)
              {
                  var isMacOS = Eto.Platform.Detect.IsMac;
      
                  var featureSelect = new TreeGridView()
      Severity: Major
      Found in Caribou/Forms/UI/TableStrip.cs - About 3 hrs to fix

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

                [TestMethod]
                public void TranslateLatLonToXYInMM()
                {
                    var lengthPerDegree = TranslateToXYManually.GetDegreesPerAxis(testMinBounds, testMaxBounds, mmScale);
        
        
        Severity: Major
        Found in Caribou.Tests/Models/TestLatLonToXY.cs and 1 other location - About 3 hrs to fix
        Caribou.Tests/Models/TestLatLonToXY.cs on lines 30..42

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

        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

                [TestMethod]
                public void TranslateLatLonToXYInM()
                {
                    var lengthPerDegree = TranslateToXYManually.GetDegreesPerAxis(testMinBounds, testMaxBounds, mScale);
        
        
        Severity: Major
        Found in Caribou.Tests/Models/TestLatLonToXY.cs and 1 other location - About 3 hrs to fix
        Caribou.Tests/Models/TestLatLonToXY.cs on lines 44..56

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

        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.Profiling
        {
            using System;
            using System.Collections.Generic;
            using System.Security.Cryptography;
        Severity: Major
        Found in Caribou.Profiling/ChicagoBenchmarks.cs and 1 other location - About 3 hrs to fix
        Caribou.Profiling/MelbourneBenchmarks.cs on lines 1..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 216.

        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.Profiling
        {
            using System;
            using System.Collections.Generic;
            using System.Security.Cryptography;
        Severity: Major
        Found in Caribou.Profiling/MelbourneBenchmarks.cs and 1 other location - About 3 hrs to fix
        Caribou.Profiling/ChicagoBenchmarks.cs on lines 1..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 216.

        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 a Cognitive Complexity of 37 (exceeds 20 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: Minor
        Found in Caribou/Processing/ParseViaXMLReader.cs - About 3 hrs 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 BuildingBrepsFromCoords has a Cognitive Complexity of 35 (exceeds 20 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

        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

                [TestMethod]
                public void ParseWaysGivenDoubleKeyViaXMLReader()
                {
                    var query = new OSMTag("addr:street", "Swanston Street");
                    var test = new ParseRequest(new List<OSMTag>() { query });
        Severity: Major
        Found in Caribou.Tests/Parsing/TestWayParsingLarge.cs and 1 other location - About 2 hrs to fix
        Caribou.Tests/Parsing/TestNodeParsingLarge.cs on lines 65..77

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

        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

                [TestMethod]
                public void ParseNodesGivenDoubleKeyViaXMLReader()
                {
                    var query = new OSMTag("addr:street", "Swanston Street");
                    var test = new ParseRequest(new List<OSMTag>() { query });
        Severity: Major
        Found in Caribou.Tests/Parsing/TestNodeParsingLarge.cs and 1 other location - About 2 hrs to fix
        Caribou.Tests/Parsing/TestWayParsingLarge.cs on lines 74..86

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

        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 static void CheckBounds(Tuple<Coord, Coord> bounds, ref double? currentMinLat, ref double? currentMinLon,
                                                                  ref double? currentMaxLat, ref double? currentMaxLon)
                {
                    var boundsMinLat = bounds.Item1.Latitude;
                    if (!currentMinLat.HasValue || boundsMinLat < currentMinLat)
        Severity: Major
        Found in Caribou/Processing/ParseViaLinq.cs and 1 other location - About 2 hrs to fix
        Caribou/Processing/ParseViaXMLReader.cs on lines 204..230

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

        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 static void CheckBounds(Tuple<Coord, Coord> bounds, 
                    ref double? currentMinLat, ref double? currentMinLon, ref double? currentMaxLat, ref double? currentMaxLon)
                {
                    var boundsMinLat = bounds.Item1.Latitude;
                    if (!currentMinLat.HasValue || boundsMinLat < currentMinLat)
        Severity: Major
        Found in Caribou/Processing/ParseViaXMLReader.cs and 1 other location - About 2 hrs to fix
        Caribou/Processing/ParseViaLinq.cs on lines 96..122

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

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

                public override void DoWork(Action<string, double> reportProgress, Action done)
                {
                    logger.Reset();
                    logger.indexOfDebugOutput = 4; // Dynamic nature of class params requires manually specifying debug log output index
                    string typeName = Enum.GetName(typeof(OSMGeometryType), this.WorkerType());
        Severity: Major
        Found in Caribou/Workers/BaseLoadAndParseWorker.cs - About 2 hrs to fix
          Severity
          Category
          Status
          Source
          Language