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
Sonar Plugins
  • Sonar Plugins
  • SONARPLUGINS-2500

Rule: Avoid empty block

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: JAVASCRIPT-1.2
  • Component/s: JavaScript
  • Labels:
    None
  • Number of attachments :
    0

Description

  • Title
    Avoid empty block
  • Description
    In most cases, en empty block represents a missing implementation.

examples :

if(something){   /*Non-Compliant*/
   //What ?
}

for (var i=0;i<cars.length;i++) { /*Non-Compliant*/
   //Empty on purpose or missing piece of code ?
}
  • Violation message
    Provide the missing piece of code
  • Default severity
    Major

Part of Sonar way quality profile

Issue Links

is related to

Task - A task that needs to be done. SONARPLUGINS-2515 Update the SQALE mapping for new rules

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Fabrice Bellingard added a comment - 12/Dec/12 7:28 AM

Empty function blocks should be considered as well.

Show
Fabrice Bellingard added a comment - 12/Dec/12 7:28 AM Empty function blocks should be considered as well.
Hide
Permalink
Evgeny Mandrikov added a comment - 12/Dec/12 7:46 AM

Fixed.

Show
Evgeny Mandrikov added a comment - 12/Dec/12 7:46 AM Fixed.
Hide
Permalink
Fabrice Bellingard added a comment - 12/Dec/12 8:29 AM

Manually tested.

Show
Fabrice Bellingard added a comment - 12/Dec/12 8:29 AM Manually tested.
Hide
Permalink
Evgeny Mandrikov added a comment - 12/Dec/12 8:52 AM

Integration tests were updated.

Show
Evgeny Mandrikov added a comment - 12/Dec/12 8:52 AM Integration tests were updated.
Hide
Permalink
Evgeny Mandrikov added a comment - 12/Dec/12 9:14 AM

In fact we decided to revert change on functions as it generates false-positives.

Show
Evgeny Mandrikov added a comment - 12/Dec/12 9:14 AM In fact we decided to revert change on functions as it generates false-positives.

People

  • Assignee:
    Evgeny Mandrikov
    Reporter:
    Freddy Mallet
Vote (0)
Watch (3)

Dates

  • Created:
    03/Dec/12 4:05 PM
    Updated:
    12/Dec/12 9:16 AM
    Resolved:
    12/Dec/12 9:16 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.