ninoseki/SimpleWhatWeb

View on GitHub

Showing 506 of 506 total issues

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

  def aggressive(target)
    m = []

    # the paths are relative to the url path if they don't start with /
    # this path, with this md5 = this version
Severity: Minor
Found in lib/whatweb/plugins/typo3.rb - About 2 hrs to fix

    Method aggressive has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

      def aggressive(target)
        m = []
    
        # Check HTTP Header
        if target.headers["server"] =~ /Conexant-EmWeb\/([^\r^\n]+)/ || target.headers["server"] =~ /Virata-EmWeb\/([^\r^\n]+)/
    Severity: Minor
    Found in lib/whatweb/plugins/conexant-emweb.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 passive has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

      def passive(target)
        m = []
    
        # mosvisitor cookie # Also used by mambo
        m << { certainty: 75, name: "mosvisitor cookie" } if target.headers["set-cookie"] =~ /mosvisitor=[0-9]+/
    Severity: Minor
    Found in lib/whatweb/plugins/joomla.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 aggressive has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def aggressive(target)
        m = []
    
        url = URI.join(target.uri.to_s, "/contao/").to_s
        new_target = WhatWeb::Target.new(url)
    Severity: Minor
    Found in lib/whatweb/plugins/contao.rb - About 1 hr to fix

      Method passive has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

        def passive(target)
          m = []
      
          # HTTP Server Header
          if /^Virtual Web/.match?(target.headers["server"])
      Severity: Minor
      Found in lib/whatweb/plugins/prolink-router.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 passive has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

        def passive(target)
          m = []
      
          # JSESSIONID Cookie
          m << { name: "JSESSIONID Cookie" } if target.headers["set-cookie"] =~ /JSESSIONID=[^;]{0,32};[\s]?path=\//i
      Severity: Minor
      Found in lib/whatweb/plugins/java.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 passive has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

        def passive(target)
          m = []
      
          regexps = [
            /ids-policy rate-frame-type-param disassoc node-time-interval/,
      Severity: Minor
      Found in lib/whatweb/plugins/aruba-mobility-controller-config-file.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 passive has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

        def passive(target)
          m = []
      
          # No server HTTP header
          if target.headers["server"].nil?
      Severity: Minor
      Found in lib/whatweb/plugins/tutortrac.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 aggressive has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def aggressive(target)
          m = []
      
          # the paths are relative to the url path if they don't start with /
          # this path, with this md5 = this version
      Severity: Minor
      Found in lib/whatweb/plugins/fluxbb.rb - About 1 hr to fix

        Method passive has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def passive(target)
            m = []
        
            unless target.headers["server"].nil?
        
        
        Severity: Minor
        Found in lib/whatweb/plugins/http-server.rb - About 1 hr to fix

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

              if target.uri.to_s =~ /\/main\.htm/ && target.body =~ /\{set\("modelname", "([^"]+)"\);set\("mac", "([^"]+)"\);set\("serialno", "([^"]+)"\);set\("ver", "([^"]+)"\);setlabel\("([^"]+)"\);uptime\("([^"]+)"\);\}<\/Script>/
          
                result = target.body.scan(/\{set\("modelname", "([^"]+)"\);set\("mac", "([^"]+)"\);set\("serialno", "([^"]+)"\);set\("ver", "([^"]+)"\);setlabel\("([^"]+)"\);uptime\("([^"]+)"\);\}<\/Script>/)[0]
          
                device[:model] << result[0].to_s
          Severity: Major
          Found in lib/whatweb/plugins/moxa-nport-device.rb and 1 other location - About 1 hr to fix
          lib/whatweb/plugins/moxa-nport-device.rb on lines 74..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 67.

          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 target.uri.to_s =~ /\/main\.htm/ && target.body =~ /\{document.getElementById\("modelname"\).innerHTML="([^"]+)";document.getElementById\("mac"\).innerHTML="([^"]+)";document.getElementById\("serialno"\).innerHTML="([^"]+)";document.getElementById\("ver"\).innerHTML="([^"]+)";setlabel\("([^"]+)"\);uptime\("([^"]+)"\);\}<\/Script>/
          
                result = target.body.scan(/\{document.getElementById\("modelname"\).innerHTML="([^"]+)";document.getElementById\("mac"\).innerHTML="([^"]+)";document.getElementById\("serialno"\).innerHTML="([^"]+)";document.getElementById\("ver"\).innerHTML="([^"]+)";setlabel\("([^"]+)"\);uptime\("([^"]+)"\);\}<\/Script>/)[0]
          
                device[:model] << result[0].to_s
          Severity: Major
          Found in lib/whatweb/plugins/moxa-nport-device.rb and 1 other location - About 1 hr to fix
          lib/whatweb/plugins/moxa-nport-device.rb on lines 60..71

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

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

            def aggressive(target)
              m = []
          
              # the paths are relative to the url path if they don't start with /
              # this path, with this md5 = this version
          Severity: Minor
          Found in lib/whatweb/plugins/punbb.rb - About 1 hr to fix

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

              def aggressive(target)
                m = []
            
                # Extract details from /phpinfo.php
                url = URI.join(target.uri.to_s, "/xampp/phpinfo.php").to_s
            Severity: Minor
            Found in lib/whatweb/plugins/xampp.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 passive has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

              def passive(target)
                m = []
            
                # HTTP Server Header
                if /^Axel Admin Server$/.match?(target.headers["server"])
            Severity: Minor
            Found in lib/whatweb/plugins/axel-device.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 startup has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def startup
                # ok, set up @rfile. open once.
                whatweb_folder = __dir__
                country_db = whatweb_folder + "/country-ips.dat"
            
            
            Severity: Minor
            Found in lib/whatweb/plugins/country.rb - About 1 hr to fix

              Method aggressive has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def aggressive(target)
                  m = []
              
                  # the paths are relative to the url path if they don't start with /
                  # this path, with this md5 = this version
              Severity: Minor
              Found in lib/whatweb/plugins/serendipity.rb - About 1 hr to fix

                Method aggressive has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def aggressive(target)
                    m = []
                
                    # the paths are relative to the url path if they don't start with /
                    # this path, with this md5 = this version
                Severity: Minor
                Found in lib/whatweb/plugins/smf.rb - About 1 hr to fix

                  Method passive has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def passive(target)
                      m = []
                      found = []
                      normal_headers = %w|accept-ranges age allow cache-control cachecontrol connection content-disposition content-encoding content-language content-length content-location content-md5 content-range content-type date etag expires host last-modified location mime-version p3p pragma proxy-authenticate refresh server set-cookie status strict-transport-security trailer transfer-encoding vary via warning www-authenticate x-aspnet-version x-cache x-cache-lookup x-pad x-powered-by x-runtime x-ua-compatible x-frame-options x-xss-protection x-pingback keep-alive|
                  
                  
                  Severity: Minor
                  Found in lib/whatweb/plugins/uncommon-headers.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 passive has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def passive(target)
                      m = []
                  
                      # Extract plugin details
                      if target.body =~ /^# redistribution and commercial restrictions. Please see the WhatWeb/ || target.body =~ /^# This file is part of WhatWeb and may be subject to/
                  Severity: Minor
                  Found in lib/whatweb/plugins/whatweb-plugin.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

                  Severity
                  Category
                  Status
                  Source
                  Language