wpscanteam/wpscan

View on GitHub

Showing 27 of 27 total issues

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

  module Finders
    module Themes
      # Known Locations Themes Finder
      class KnownLocations < CMSScanner::Finders::Finder
        include CMSScanner::Finders::Finder::Enumerator
Severity: Major
Found in app/finders/themes/known_locations.rb and 1 other location - About 3 hrs to fix
app/finders/plugins/known_locations.rb on lines 4..51

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

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

  module Finders
    module Plugins
      # Known Locations Plugins Finder
      class KnownLocations < CMSScanner::Finders::Finder
        include CMSScanner::Finders::Finder::Enumerator
Severity: Major
Found in app/finders/plugins/known_locations.rb and 1 other location - About 3 hrs to fix
app/finders/themes/known_locations.rb on lines 4..51

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

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

      def enum_plugins
        opts = default_opts('plugins').merge(
          list: plugins_list_from_opts(ParsedCli.options),
          threshold: ParsedCli.plugins_threshold,
          sort: true
Severity: Major
Found in app/controllers/enumeration/enum_methods.rb and 1 other location - About 1 hr to fix
app/controllers/enumeration/enum_methods.rb on lines 109..130

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

      def enum_themes
        opts = default_opts('themes').merge(
          list: themes_list_from_opts(ParsedCli.options),
          threshold: ParsedCli.themes_threshold,
          sort: true
Severity: Major
Found in app/controllers/enumeration/enum_methods.rb and 1 other location - About 1 hr to fix
app/controllers/enumeration/enum_methods.rb on lines 62..83

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

        def attack(users, wordlist_path, opts = {})
          checked_passwords      = 0
          wordlist               = File.open(wordlist_path)
          wordlist_size          = wordlist.count
          max_passwords          = opts[:multicall_max_passwords]
Severity: Minor
Found in app/finders/passwords/xml_rpc_multicall.rb - About 1 hr to fix

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

          def cli_enum_choices
            [
              OptMultiChoices.new(
                ['-e', '--enumerate [OPTS]', 'Enumeration Process'],
                choices: {
    Severity: Minor
    Found in app/controllers/enumeration/cli_options.rb - About 1 hr to fix

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

        module Finders
          module Plugins
            # URLs In Homepage Finder
            # Typically, the items detected from URLs like /wp-content/plugins/<slug>/
            class UrlsInHomepage < CMSScanner::Finders::Finder
      Severity: Minor
      Found in app/finders/plugins/urls_in_homepage.rb and 1 other location - About 1 hr to fix
      app/finders/themes/urls_in_homepage.rb on lines 4..26

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

      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

        module Finders
          module Themes
            # URLs In Homepage Finder
            class UrlsInHomepage < CMSScanner::Finders::Finder
              include WpItems::UrlsInPage
      Severity: Minor
      Found in app/finders/themes/urls_in_homepage.rb and 1 other location - About 1 hr to fix
      app/finders/plugins/urls_in_homepage.rb on lines 4..27

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

      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 attack has a Cognitive Complexity of 19 (exceeds 15 allowed). Consider refactoring.
      Open

              def attack(users, wordlist_path, opts = {})
                checked_passwords      = 0
                wordlist               = File.open(wordlist_path)
                wordlist_size          = wordlist.count
                max_passwords          = opts[:multicall_max_passwords]
      Severity: Minor
      Found in app/finders/passwords/xml_rpc_multicall.rb - About 55 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

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

              def initialize(target)
                finders <<
                  Users::AuthorPosts.new(target) <<
                  Users::WpJsonApi.new(target) <<
                  Users::OembedApi.new(target) <<
      Severity: Minor
      Found in app/finders/users.rb and 1 other location - About 50 mins to fix
      app/finders/plugins.rb on lines 23..32

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

      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

              def initialize(target)
                finders <<
                  Plugins::UrlsInHomepage.new(target) <<
                  Plugins::UrlsIn404Page.new(target) <<
                  Plugins::HeaderPattern.new(target) <<
      Severity: Minor
      Found in app/finders/plugins.rb and 1 other location - About 50 mins to fix
      app/finders/users.rb on lines 30..39

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

      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 process_response has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              def process_response(opts, response, slug, klass, config)
      Severity: Minor
      Found in app/finders/plugins/xpath.rb - About 35 mins to fix

        Method process_response has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                def process_response(opts, response, slug, klass, config)
        Severity: Minor
        Found in app/finders/plugins/javascript_var.rb - About 35 mins to fix

          Method process_response has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  def process_response(opts, response, slug, klass, config)
          Severity: Minor
          Found in app/finders/plugins/body_pattern.rb - About 35 mins to fix

            Method _process_response has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    def _process_response(_opts, _response, slug, klass, config)
            Severity: Minor
            Found in app/finders/plugins/config_parser.rb - About 35 mins to fix

              Method process_response has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      def process_response(opts, response, slug, klass, config)
              Severity: Minor
              Found in app/finders/plugins/comment.rb - About 35 mins to fix

                Method process_response has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        def process_response(opts, response, slug, klass, config)
                Severity: Minor
                Found in app/finders/plugins/query_parameter.rb - About 35 mins to fix

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

                        def cli_db_exports_opts
                          [
                            OptFilePath.new(
                              ['--db-exports-list FILE-PATH', 'List of DB exports\' paths to use'],
                              exists: true, default: DB_DIR.join('db_exports.txt').to_s, advanced: true
                  Severity: Minor
                  Found in app/controllers/enumeration/cli_options.rb and 2 other locations - About 30 mins to fix
                  app/controllers/enumeration/cli_options.rb on lines 106..117
                  app/controllers/enumeration/cli_options.rb on lines 121..132

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

                  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

                        def cli_timthumbs_opts
                          [
                            OptFilePath.new(
                              ['--timthumbs-list FILE-PATH', 'List of timthumbs\' location to use'],
                              exists: true, default: DB_DIR.join('timthumbs-v3.txt').to_s, advanced: true
                  Severity: Minor
                  Found in app/controllers/enumeration/cli_options.rb and 2 other locations - About 30 mins to fix
                  app/controllers/enumeration/cli_options.rb on lines 121..132
                  app/controllers/enumeration/cli_options.rb on lines 136..147

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

                  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

                        def cli_config_backups_opts
                          [
                            OptFilePath.new(
                              ['--config-backups-list FILE-PATH', 'List of config backups\' filenames to use'],
                              exists: true, default: DB_DIR.join('config_backups.txt').to_s, advanced: true
                  Severity: Minor
                  Found in app/controllers/enumeration/cli_options.rb and 2 other locations - About 30 mins to fix
                  app/controllers/enumeration/cli_options.rb on lines 106..117
                  app/controllers/enumeration/cli_options.rb on lines 136..147

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

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language