mtwilliams/visual_studio

View on GitHub

Showing 7 of 7 total issues

Method find has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def self.find(version)
        if Windows::SoftwareDevelopmentKit::VERSIONS.include?(version)
          # TODO(mtwilliams): Select the 64-bit and ARM host variants when
          # applicable, i.e. when running on 64-bit or ARM.

Severity: Major
Found in lib/visual_studio/sdks/windows.rb - About 2 hrs to fix

    Method find has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

          def self.find(version)
            if Windows::SoftwareDevelopmentKit::VERSIONS.include?(version)
              # TODO(mtwilliams): Select the 64-bit and ARM host variants when
              # applicable, i.e. when running on 64-bit or ARM.
    
    
    Severity: Minor
    Found in lib/visual_studio/sdks/windows.rb - 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

    Method find has 59 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def self.find(product, version)
          if VisualStudio::Product::NAMES.include?(product)
            name = Helpers::PrettyString.new product,
                                             pretty: VisualStudio::VERSION_TO_PRETTY_NAME[version]
    
    
    Severity: Major
    Found in lib/visual_studio/product.rb - About 2 hrs to fix

      Method environment has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def environment(opts={})
            # TODO(mtwilliams): Raise an exception.
            return nil unless @name.to_s == 'VC'
      
            target = opts[:target] || {platform: :windows,
      Severity: Minor
      Found in lib/visual_studio/product.rb - 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 find has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def self.find(product, version)
            if VisualStudio::Product::NAMES.include?(product)
              name = Helpers::PrettyString.new product,
                                               pretty: VisualStudio::VERSION_TO_PRETTY_NAME[version]
      
      
      Severity: Minor
      Found in lib/visual_studio/product.rb - 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 environment has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def environment(opts={})
            # TODO(mtwilliams): Raise an exception.
            return nil unless @name.to_s == 'VC'
      
            target = opts[:target] || {platform: :windows,
      Severity: Minor
      Found in lib/visual_studio/product.rb - About 1 hr to fix

        Method merge has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def self.merge(base, overlay)
              # We merge case insensitively, because Windows. We treat |base| case as canonical
              # unless the variable is only named by |overlay|.
              cased = (overlay.keys + base.keys).uniq.map{|key| [key.upcase, key]}.to_h
        
        
        Severity: Minor
        Found in lib/visual_studio/environment.rb - 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

        Severity
        Category
        Status
        Source
        Language