FarmBot/OpenFarm

View on GitHub

Showing 2,687 of 2,687 total issues

Server side request forgery in gibbon
Open

    gibbon (1.2.1)
Severity: Minor
Found in Gemfile.lock by bundler-audit

Advisory: CVE-2022-27311

Criticality: Critical

URL: https://github.com/amro/gibbon/pull/321

Solution: upgrade to >= 3.4.4

ReDoS based DoS vulnerability in GlobalID
Open

    globalid (0.4.2)
Severity: Minor
Found in Gemfile.lock by bundler-audit

Advisory: CVE-2023-22799

URL: https://github.com/rails/globalid/releases/tag/v1.0.1

Solution: upgrade to >= 1.0.1

Line is too long. [912/120]
Open

      .to_return(:body => '{"total":1,"data":[{"id":"7ec999ba49","web_id":540717,"name":"OpenFarm Helpers","date_created":"2015-04-03 08:25:15","email_type_option":false,"use_awesomebar":true,"default_from_name":"The OpenFarm Team","default_from_email":"kevin@openfarm.cc","default_subject":"","default_language":"en","list_rating":0,"subscribe_url_short":"http:\/\/eepurl.com\/biTabv","subscribe_url_long":"http:\/\/openfarm.us8.list-manage.com\/subscribe?u=&id=7ec999ba49","beamer_address":"us8@inbound.mailchimp.com","visibility":"pub","stats":{"member_count":24,"unsubscribe_count":0,"cleaned_count":0,"member_count_since_send":27,"unsubscribe_count_since_send":0,"cleaned_count_since_send":0,"campaign_count":0,"grouping_count":0,"group_count":0,"merge_var_count":1,"avg_sub_rate":0,"avg_unsub_rate":0,"target_sub_rate":0,"open_rate":0,"click_rate":0,"date_last_campaign":null},"modules":[]}],"errors":[]}')
Severity: Minor
Found in spec/models/user_spec.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/IndentationStyle cop. It also ignores a shebang line by default.

This cop has some autocorrection capabilities. It can programmatically shorten certain long lines by inserting line breaks into expressions that can be safely split across lines. These include arrays, hashes, and method calls with argument lists.

If autocorrection is enabled, the following Layout cops are recommended to further format the broken lines. (Many of these are enabled by default.)

  • ArgumentAlignment
  • BlockAlignment
  • BlockDelimiters
  • BlockEndNewline
  • ClosingParenthesisIndentation
  • FirstArgumentIndentation
  • FirstArrayElementIndentation
  • FirstHashElementIndentation
  • FirstParameterIndentation
  • HashAlignment
  • IndentationWidth
  • MultilineArrayLineBreaks
  • MultilineBlockLayout
  • MultilineHashBraceLayout
  • MultilineHashKeyLineBreaks
  • MultilineMethodArgumentLineBreaks
  • ParameterAlignment

Together, these cops will pretty print hashes, arrays, method calls, etc. For example, let's say the max columns is 25:

Example:

# bad
{foo: "0000000000", bar: "0000000000", baz: "0000000000"}

# good
{foo: "0000000000",
bar: "0000000000", baz: "0000000000"}

# good (with recommended cops enabled)
{
  foo: "0000000000",
  bar: "0000000000",
  baz: "0000000000",
}

Line is too long. [912/120]
Open

      .to_return(:body => '{"total":1,"data":[{"id":"7ec999ba49","web_id":540717,"name":"OpenFarm Helpers","date_created":"2015-04-03 08:25:15","email_type_option":false,"use_awesomebar":true,"default_from_name":"The OpenFarm Team","default_from_email":"kevin@openfarm.cc","default_subject":"","default_language":"en","list_rating":0,"subscribe_url_short":"http:\/\/eepurl.com\/biTabv","subscribe_url_long":"http:\/\/openfarm.us8.list-manage.com\/subscribe?u=&id=7ec999ba49","beamer_address":"us8@inbound.mailchimp.com","visibility":"pub","stats":{"member_count":24,"unsubscribe_count":0,"cleaned_count":0,"member_count_since_send":27,"unsubscribe_count_since_send":0,"cleaned_count_since_send":0,"campaign_count":0,"grouping_count":0,"group_count":0,"merge_var_count":1,"avg_sub_rate":0,"avg_unsub_rate":0,"target_sub_rate":0,"open_rate":0,"click_rate":0,"date_last_campaign":null},"modules":[]}],"errors":[]}')
Severity: Minor
Found in spec/models/user_spec.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/IndentationStyle cop. It also ignores a shebang line by default.

This cop has some autocorrection capabilities. It can programmatically shorten certain long lines by inserting line breaks into expressions that can be safely split across lines. These include arrays, hashes, and method calls with argument lists.

If autocorrection is enabled, the following Layout cops are recommended to further format the broken lines. (Many of these are enabled by default.)

  • ArgumentAlignment
  • BlockAlignment
  • BlockDelimiters
  • BlockEndNewline
  • ClosingParenthesisIndentation
  • FirstArgumentIndentation
  • FirstArrayElementIndentation
  • FirstHashElementIndentation
  • FirstParameterIndentation
  • HashAlignment
  • IndentationWidth
  • MultilineArrayLineBreaks
  • MultilineBlockLayout
  • MultilineHashBraceLayout
  • MultilineHashKeyLineBreaks
  • MultilineMethodArgumentLineBreaks
  • ParameterAlignment

Together, these cops will pretty print hashes, arrays, method calls, etc. For example, let's say the max columns is 25:

Example:

# bad
{foo: "0000000000", bar: "0000000000", baz: "0000000000"}

# good
{foo: "0000000000",
bar: "0000000000", baz: "0000000000"}

# good (with recommended cops enabled)
{
  foo: "0000000000",
  bar: "0000000000",
  baz: "0000000000",
}

Line is too long. [912/120]
Open

      .to_return(:body => '{"total":1,"data":[{"id":"7ec999ba49","web_id":540717,"name":"OpenFarm Helpers","date_created":"2015-04-03 08:25:15","email_type_option":false,"use_awesomebar":true,"default_from_name":"The OpenFarm Team","default_from_email":"kevin@openfarm.cc","default_subject":"","default_language":"en","list_rating":0,"subscribe_url_short":"http:\/\/eepurl.com\/biTabv","subscribe_url_long":"http:\/\/openfarm.us8.list-manage.com\/subscribe?u=&id=7ec999ba49","beamer_address":"us8@inbound.mailchimp.com","visibility":"pub","stats":{"member_count":24,"unsubscribe_count":0,"cleaned_count":0,"member_count_since_send":27,"unsubscribe_count_since_send":0,"cleaned_count_since_send":0,"campaign_count":0,"grouping_count":0,"group_count":0,"merge_var_count":1,"avg_sub_rate":0,"avg_unsub_rate":0,"target_sub_rate":0,"open_rate":0,"click_rate":0,"date_last_campaign":null},"modules":[]}],"errors":[]}')
Severity: Minor
Found in spec/models/user_spec.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/IndentationStyle cop. It also ignores a shebang line by default.

This cop has some autocorrection capabilities. It can programmatically shorten certain long lines by inserting line breaks into expressions that can be safely split across lines. These include arrays, hashes, and method calls with argument lists.

If autocorrection is enabled, the following Layout cops are recommended to further format the broken lines. (Many of these are enabled by default.)

  • ArgumentAlignment
  • BlockAlignment
  • BlockDelimiters
  • BlockEndNewline
  • ClosingParenthesisIndentation
  • FirstArgumentIndentation
  • FirstArrayElementIndentation
  • FirstHashElementIndentation
  • FirstParameterIndentation
  • HashAlignment
  • IndentationWidth
  • MultilineArrayLineBreaks
  • MultilineBlockLayout
  • MultilineHashBraceLayout
  • MultilineHashKeyLineBreaks
  • MultilineMethodArgumentLineBreaks
  • ParameterAlignment

Together, these cops will pretty print hashes, arrays, method calls, etc. For example, let's say the max columns is 25:

Example:

# bad
{foo: "0000000000", bar: "0000000000", baz: "0000000000"}

# good
{foo: "0000000000",
bar: "0000000000", baz: "0000000000"}

# good (with recommended cops enabled)
{
  foo: "0000000000",
  bar: "0000000000",
  baz: "0000000000",
}

Line is too long. [912/120]
Open

      .to_return(:body => '{"total":1,"data":[{"id":"7ec999ba49","web_id":540717,"name":"OpenFarm Helpers","date_created":"2015-04-03 08:25:15","email_type_option":false,"use_awesomebar":true,"default_from_name":"The OpenFarm Team","default_from_email":"kevin@openfarm.cc","default_subject":"","default_language":"en","list_rating":0,"subscribe_url_short":"http:\/\/eepurl.com\/biTabv","subscribe_url_long":"http:\/\/openfarm.us8.list-manage.com\/subscribe?u=&id=7ec999ba49","beamer_address":"us8@inbound.mailchimp.com","visibility":"pub","stats":{"member_count":24,"unsubscribe_count":0,"cleaned_count":0,"member_count_since_send":27,"unsubscribe_count_since_send":0,"cleaned_count_since_send":0,"campaign_count":0,"grouping_count":0,"group_count":0,"merge_var_count":1,"avg_sub_rate":0,"avg_unsub_rate":0,"target_sub_rate":0,"open_rate":0,"click_rate":0,"date_last_campaign":null},"modules":[]}],"errors":[]}')
Severity: Minor
Found in spec/models/user_spec.rb by rubocop

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/IndentationStyle cop. It also ignores a shebang line by default.

This cop has some autocorrection capabilities. It can programmatically shorten certain long lines by inserting line breaks into expressions that can be safely split across lines. These include arrays, hashes, and method calls with argument lists.

If autocorrection is enabled, the following Layout cops are recommended to further format the broken lines. (Many of these are enabled by default.)

  • ArgumentAlignment
  • BlockAlignment
  • BlockDelimiters
  • BlockEndNewline
  • ClosingParenthesisIndentation
  • FirstArgumentIndentation
  • FirstArrayElementIndentation
  • FirstHashElementIndentation
  • FirstParameterIndentation
  • HashAlignment
  • IndentationWidth
  • MultilineArrayLineBreaks
  • MultilineBlockLayout
  • MultilineHashBraceLayout
  • MultilineHashKeyLineBreaks
  • MultilineMethodArgumentLineBreaks
  • ParameterAlignment

Together, these cops will pretty print hashes, arrays, method calls, etc. For example, let's say the max columns is 25:

Example:

# bad
{foo: "0000000000", bar: "0000000000", baz: "0000000000"}

# good
{foo: "0000000000",
bar: "0000000000", baz: "0000000000"}

# good (with recommended cops enabled)
{
  foo: "0000000000",
  bar: "0000000000",
  baz: "0000000000",
}

Block has too many lines. [174/25]
Open

describe Api::V1::GardenCropsController, type: :controller do
  include ApiHelpers

  describe 'create' do
    before do

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

Class has too many lines. [173/100]
Open

class Guide
  include Mongoid::Document
  include Mongoid::Paperclip
  include Mongoid::Slug
  include Mongoid::Timestamps
Severity: Minor
Found in app/models/guide.rb by rubocop

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Function newGuideCtrl has 313 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function newGuideCtrl(
    $scope,
    $http,
    $q,
    guideService,
Severity: Major
Found in app/assets/javascripts/guides/new.js - About 1 day to fix

    Line is too long. [265/120]
    Open

        attributes = {"name"=>"The Hanoi Balcony", "location"=>"Inside", "description"=>"We created this garden automatically to get\nyou started. You can edit it to better suit\nyour needs!", "type"=>"Inside", "average_sun"=>"Full Sun", "soil_type"=>"Loam", "ph"=>7.5}

    This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/IndentationStyle cop. It also ignores a shebang line by default.

    This cop has some autocorrection capabilities. It can programmatically shorten certain long lines by inserting line breaks into expressions that can be safely split across lines. These include arrays, hashes, and method calls with argument lists.

    If autocorrection is enabled, the following Layout cops are recommended to further format the broken lines. (Many of these are enabled by default.)

    • ArgumentAlignment
    • BlockAlignment
    • BlockDelimiters
    • BlockEndNewline
    • ClosingParenthesisIndentation
    • FirstArgumentIndentation
    • FirstArrayElementIndentation
    • FirstHashElementIndentation
    • FirstParameterIndentation
    • HashAlignment
    • IndentationWidth
    • MultilineArrayLineBreaks
    • MultilineBlockLayout
    • MultilineHashBraceLayout
    • MultilineHashKeyLineBreaks
    • MultilineMethodArgumentLineBreaks
    • ParameterAlignment

    Together, these cops will pretty print hashes, arrays, method calls, etc. For example, let's say the max columns is 25:

    Example:

    # bad
    {foo: "0000000000", bar: "0000000000", baz: "0000000000"}
    
    # good
    {foo: "0000000000",
    bar: "0000000000", baz: "0000000000"}
    
    # good (with recommended cops enabled)
    {
      foo: "0000000000",
      bar: "0000000000",
      baz: "0000000000",
    }

    Block has too many lines. [147/25]
    Open

    describe Api::V1::GardensController, type: :controller do
      include ApiHelpers
    
      describe "index" do
        before do

    This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

    Block has too many lines. [144/25]
    Open

    describe Api::V1::GuidesController, type: :controller do
      include ApiHelpers
    
      let(:user) { sign_in(user = FactoryBot.create(:user)) && user }
      let(:guide) { FactoryBot.create(:guide, user: user) }

    This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

    Block has too many lines. [140/25]
    Open

    describe Api::V1::StagesController, type: :controller do
      include ApiHelpers
    
      let!(:user) { sign_in(user = FactoryBot.create(:user)) && user }
      let(:guide) { FactoryBot.create(:guide, user: user) }

    This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

    Block has too many lines. [126/25]
    Open

    describe Users::UpdateUser do
      let(:mutation) { Users::UpdateUser }
    
      let(:other_user) { FactoryBot.create(:user) }
      let(:current_user) { FactoryBot.create(:user) }

    This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

    Function newGuideCtrl has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
    Open

      function newGuideCtrl(
        $scope,
        $http,
        $q,
        guideService,
    Severity: Minor
    Found in app/assets/javascripts/guides/new.js - About 1 day 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

    Function showGuideCtrl has 214 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function showGuideCtrl(
        $scope,
        $http,
        guideService,
        $q,
    Severity: Major
    Found in app/assets/javascripts/guides/show.js - About 1 day to fix

      Improper neutralization of data URIs may allow XSS in rails-html-sanitizer
      Open

          rails-html-sanitizer (1.3.0)
      Severity: Minor
      Found in Gemfile.lock by bundler-audit

      Advisory: CVE-2022-23518

      Criticality: Medium

      URL: https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-mcvf-2q2m-x72m

      Solution: upgrade to >= 1.4.4

      Improper neutralization of data URIs may allow XSS in Loofah
      Open

          loofah (2.5.0)
      Severity: Minor
      Found in Gemfile.lock by bundler-audit

      Advisory: CVE-2022-23515

      Criticality: Medium

      URL: https://github.com/flavorjones/loofah/security/advisories/GHSA-228g-948r-83gx

      Solution: upgrade to >= 2.19.1

      Integer Overflow or Wraparound in libxml2 affects Nokogiri
      Open

          nokogiri (1.10.9)
      Severity: Critical
      Found in Gemfile.lock by bundler-audit

      Advisory:

      Criticality: High

      URL: https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-cgx6-hpwq-fhv5

      Solution: upgrade to >= 1.13.5

      Out-of-bounds Write in zlib affects Nokogiri
      Open

          nokogiri (1.10.9)
      Severity: Critical
      Found in Gemfile.lock by bundler-audit

      Advisory: CVE-2018-25032

      Criticality: High

      URL: https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-v6gp-9mmm-c6p5

      Solution: upgrade to >= 1.13.4

      Severity
      Category
      Status
      Source
      Language