helpyio/helpy

View on GitHub

Showing 242 of 242 total issues

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

        params do
          requires :id, type: Integer, desc: "The ID of the forum you are updating"
          requires :name, type: String, desc: "The name of the forum"
          requires :description, type: String, desc: "The description of the forum"
          optional :allow_post_voting, type: Boolean, desc: "Should topic replies be voteable?"
Severity: Minor
Found in app/controllers/api/v1/forums.rb and 1 other location - About 55 mins to fix
app/controllers/api/v1/posts.rb on lines 17..24

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

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 update has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def update
    @user = User.find(params[:id])

    fetch_counts

Severity: Minor
Found in app/controllers/admin/users_controller.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

        params do
          requires :topic_id, type: Integer, desc: "Topic to add post to"
          requires :body, type: String, desc: "The post body"
          requires :user_id, type: Integer, desc: "The User ID of the poster"
          requires :kind, type: String, desc: "The kind of post, either 'reply' or 'note'"
Severity: Minor
Found in app/controllers/api/v1/posts.rb and 1 other location - About 55 mins to fix
app/controllers/api/v1/forums.rb on lines 67..74

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

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

          var $widgetIframe = $('<iframe>', {
                               src: helpyDomain + "/widget",
                               id:  'widget-frame',
                               frameborder: 0,
                               //height: 380,
Severity: Minor
Found in app/assets/javascripts/widget.v1.js and 1 other location - About 55 mins to fix
app/assets/javascripts/widget.v2.js on lines 70..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 53.

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

          var $widgetIframe = $('<iframe>', {
                               src: helpyDomain + "/widget",
                               id:  'widget-frame',
                               frameborder: 0,
                               //height: 380,
Severity: Minor
Found in app/assets/javascripts/widget.v2.js and 1 other location - About 55 mins to fix
app/assets/javascripts/widget.v1.js on lines 70..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 53.

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

Code Injection vulnerability in CarrierWave::RMagick
Open

    carrierwave (1.3.1)
Severity: Critical
Found in Gemfile.lock by bundler-audit

Advisory: CVE-2021-21305

Criticality: High

URL: https://github.com/carrierwaveuploader/carrierwave/security/advisories/GHSA-cf3w-g86h-35x4

Solution: upgrade to ~> 1.3.2, >= 2.1.1

Improper Certificate Validation in oauth ruby gem
Open

    oauth (0.5.4)
Severity: Critical
Found in Gemfile.lock by bundler-audit

Advisory: CVE-2016-11086

Criticality: High

URL: https://github.com/advisories/GHSA-7359-3c6r-hfc2

Solution: upgrade to >= 0.5.5

Server-side request forgery in CarrierWave
Open

    carrierwave (1.3.1)
Severity: Minor
Found in Gemfile.lock by bundler-audit

Advisory: CVE-2021-21288

Criticality: Medium

URL: https://github.com/carrierwaveuploader/carrierwave/security/advisories/GHSA-fwcm-636p-68r5

Solution: upgrade to ~> 1.3.2, >= 2.1.1

TZInfo relative path traversal vulnerability allows loading of arbitrary files
Open

    tzinfo (1.2.7)
Severity: Critical
Found in Gemfile.lock by bundler-audit

Advisory: CVE-2022-31163

Criticality: High

URL: https://github.com/tzinfo/tzinfo/security/advisories/GHSA-5cm2-9h8c-rvfx

Solution: upgrade to ~> 0.3.61, >= 1.2.10

Inconsistent Interpretation of HTTP Requests ('HTTP Request Smuggling') in puma
Open

    puma (5.5.0)
Severity: Info
Found in Gemfile.lock by bundler-audit

Advisory: CVE-2021-41136

Criticality: Low

URL: https://github.com/puma/puma/security/advisories/GHSA-48w2-rm65-62xx

Solution: upgrade to ~> 4.3.9, >= 5.5.1

OmniAuth's lib/omniauth/failure_endpoint.rb does not escape message_key value
Open

    omniauth (1.9.1)
Severity: Minor
Found in Gemfile.lock by bundler-audit

XML round-trip vulnerability in REXML
Open

    rexml (3.2.4)
Severity: Critical
Found in Gemfile.lock by bundler-audit

Advisory: CVE-2021-28965

Criticality: High

URL: https://www.ruby-lang.org/en/news/2021/04/05/xml-round-trip-vulnerability-in-rexml-cve-2021-28965/

Solution: upgrade to ~> 3.1.9.1, ~> 3.2.3.1, >= 3.2.5

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

            title: permitted_params[:title],
            category_id: permitted_params[:category_id],
            body: permitted_params[:body],
            user_id: permitted_params[:user_id],
            keywords: permitted_params[:keywords],
Severity: Minor
Found in app/controllers/api/v1/docs.rb and 1 other location - About 45 mins to fix
app/controllers/api/v1/docs.rb on lines 83..93

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

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

            title: permitted_params[:title],
            category_id: permitted_params[:category_id],
            body: permitted_params[:body],
            user_id: permitted_params[:user_id],
            keywords: permitted_params[:keywords],
Severity: Minor
Found in app/controllers/api/v1/docs.rb and 1 other location - About 45 mins to fix
app/controllers/api/v1/docs.rb on lines 48..58

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

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

  def perform(category, action, label, value, client_id, ga_id)
Severity: Minor
Found in app/jobs/tracker_job.rb - About 45 mins to fix

    Method update_topic has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def update_topic
    
        bulk_post_attributes = []
        if params[:change_status].present?
          user_id = current_user.id || 2
    Severity: Minor
    Found in app/controllers/admin/topics_controller.rb - About 45 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

    Method index has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def index
        @forum = Forum.ispublic.where(id: params[:forum_id]).first
        if @forum
          if @forum.allow_topic_voting == true
            @topics = @forum.topics.ispublic.by_popularity.page(params[:page]).per(15)
    Severity: Minor
    Found in app/controllers/topics_controller.rb - About 45 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

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

      def import(file_path, file_name, klass, user, import)
    Severity: Minor
    Found in app/jobs/import_job.rb - About 35 mins to fix

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

        def navbar_expanding_link(url, icon, text, target="", remote=false)
      Severity: Minor
      Found in app/helpers/admin_helper.rb - About 35 mins to fix

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

          def upper_nav_item(label, path, controllers, actions, icon="")
        Severity: Minor
        Found in app/helpers/admin_helper.rb - About 35 mins to fix
          Severity
          Category
          Status
          Source
          Language