jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
Signup
SonarQube Plugins
  • SonarQube Plugins
  • SONARPLUGINS-2491

Rule: is tail recursive

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: ERLANG-0.1
  • Component/s: Erlang
  • Labels:
    None
  • Number of attachments :
    0

Description

Create a rule to check is the method tail recursive:
it is tail recursive if the last statement is a return or a recursive call
(handle branches)

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Tamas Kende added a comment - 04/Dec/12 1:33 AM

The logic is the following:
if the arity of the actual call is equal to the arity of the actual function and there is no non tail recursive call registered in that function clause we check the following:

  • is the function call a direct child of an expression (so it is a standalone statement)
  • does any of the ancestor statement has a sibling statement (so it is not the last statement)
Show
Tamas Kende added a comment - 04/Dec/12 1:33 AM The logic is the following: if the arity of the actual call is equal to the arity of the actual function and there is no non tail recursive call registered in that function clause we check the following: is the function call a direct child of an expression (so it is a standalone statement) does any of the ancestor statement has a sibling statement (so it is not the last statement)
Hide
Permalink
Evgeny Mandrikov added a comment - 26/Dec/12 7:20 AM

Tested manually.

Show
Evgeny Mandrikov added a comment - 26/Dec/12 7:20 AM Tested manually.

People

  • Assignee:
    Tamas Kende
    Reporter:
    Tamas Kende
Vote (0)
Watch (2)

Dates

  • Created:
    29/Nov/12 7:23 AM
    Updated:
    26/Dec/12 7:20 AM
    Resolved:
    04/Dec/12 1:35 AM
  • Atlassian JIRA (v5.2.7#850-sha1:b2af0c8)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.