Giter Site home page Giter Site logo

Comments (4)

bdaase avatar bdaase commented on June 15, 2024

At the moment it looks like that magic numbers test does not check for magic numbers. You should try to lint the SLDummyClass03 with the magic numbers test, resulting in one occurrence. But there are definitely way more so it looks like the magic numbers test is not testing for magic numbers...

from swalint.

lars-seifert avatar lars-seifert commented on June 15, 2024

Magic numbers are quite simple:
"b ifNotEmpty: [b := 'hrm'] " -> There's one magic number ('hrm').
"b ifNotEmpty: [b := 'hello']" -> There's no magic number.
"b ifNotEmpty: [b := 'LarsSeifert']" -> There's one magic number.
b ifNotEmpty: [b := 'Lars Seifert'] -> There's no magic number.
b ifNotEmpty: [b := 3.1415931234] -> There's no magic number.

So it seems to be related to some sort of spelling correction, which also fits to the observation, that magic number does the same as the literal value stuff.

Also, it counts the number of methods that have 'magic values'.

from swalint.

bdaase avatar bdaase commented on June 15, 2024

Making the fix proposed in #6 (comment) does also fix the ERROR problem mentioned in this issue, only producing normal results
magic numbers no ROOR

from swalint.

lars-seifert avatar lars-seifert commented on June 15, 2024

Since this issue is about the "ERROR" message, I opened issue #23 (Magic Numbers are Numbers and not Strings).

from swalint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.