Details

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

      Description

      title

      Do not use octal numbers

      description

      Octal numbers should be avoided because the syntax to declare them (prefix by zero) makes it ambiguous for novice JavaScript developers to understand the real value of the number. For instance, the octal "0644" number actually equals to 420, not 644.

      What's more, even if all browsers support it, this syntax is not part of ECMAScript and will generate an error in JavaScript strict mode code.

      The following code snippet illustrates this rule :

      var i = 0644; // non-compliant
      var j = 420; // compliant
      

      message

      Replace the value of the octal number (

      {0}

      ) by its decimal equivalent (

      {1}

      ).

      severity

      Critical

      in Sonar way?

      Yes

        Issue Links

          Activity

          Hide
          Fabrice Bellingard added a comment -

          Manually tested.

          Show
          Fabrice Bellingard added a comment - Manually tested.
          Hide
          Evgeny Mandrikov added a comment -

          Integration tests were updated.

          Show
          Evgeny Mandrikov added a comment - Integration tests were updated.

            People

            • Assignee:
              Evgeny Mandrikov
              Reporter:
              Evgeny Mandrikov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: