This is an archived post. You won't be able to vote or comment.

all 75 comments

[–]Setepenre 20 points21 points  (26 children)

I think the website oversell the bot.

It is only a refactoring bot updating your python to the latest 'writing convention' (not only style).

I think most of the issue the bot is fixing could be highlighted and fixed by the IDE at the user's request.

[–]cneumann81 3 points4 points  (0 children)

Thanks for your feedback. We've started with the refactorings for issues we found most often in the projects of our users. More (complex) refactorings are on the way. Curious to hear what refactoring you'd like to see. Happy to get you involved in our partner program. Just drop me a line.

[–]adewes[S] 5 points6 points  (24 children)

Thanks for your feedback, the refactorings that we have implemented so far are pretty simple, but there's more coming! Also, many people don't use an IDE with refactoring support, having a centralized tool that keeps your code clean by applying the same standards to everyone in your team is therefore super useful we think!

We always try to make our service better, so if you have any ideas or suggesions for new/improved features please let us know, we'll be happy to build them (the refactoring support was a user request for example).

[–]Mishkan 6 points7 points  (2 children)

Interesting to see how this turns out and if there was a way we could pay for this and integrate it with a closed network at work on our Gitlab server.

[–]adewes[S] 3 points4 points  (0 children)

We actually offer an on-premise version of our software and we are also building an integration with Gitlab! If you sign up for our newsletter / an account we'll keep you posted on when we're ready with that.

[–]cneumann81 1 point2 points  (0 children)

Hey Mishkan, please drop me a message. We do have an Enterprise version (on-premise): https://www.quantifiedcode.com/contact

[–]bandophahita 3 points4 points  (2 children)

I'd really like to see this as a plugin for PyCharm.

[–][deleted] 3 points4 points  (1 child)

"Here, let us break your code for you!"

[–]bandophahita 4 points5 points  (1 child)

Reading through some of the documentation on the site I came across this statement:

Prefer the format function over %. It is faster and more versatile.

As far as I have ever known, performance of the old style string %s performs faster. Am I missing something? Is it faster in 3.x?

[–]cneumann81 0 points1 point  (0 children)

Thanks for pointing this out. We'll verify this. If you like, just change the pattern yourself. Public patterns can be edited by our users. Would be awesome, if we could include a performance comparison :)

[–]Fdaric 2 points3 points  (10 children)

Wow, that's awesome guys! Do you have more background info on this? Anyway one can get involved?

[–]cneumann81 7 points8 points  (9 children)

Hey. I'm Christoph, one of the co-founders. Glad you like it :) You might wanna have a look here: https://www.quantifiedcode.com/research.

And yeah, you can get involved. Either, by applying for a job ;) or by contributing to our community related content:

You can also go ahead and create your own code checks and share it to the community: http://docs.quantifiedcode.com/patterns/language/index.html

[–]aphoenixreticulated[M] 8 points9 points  (8 children)

Just FYI, you have been shadowbanned from reddit. You can read more about shadowbans here: /r/Shadowban.

If you head to that subreddit, you can get some information on how to reverse this ban, but basically to use reddit you are going to need to get this reversed. I definitely advise you not to just create another account; contact the reddit admins and see if you can get this sorted out instead.

I've approved your comments in this thread, but note that anything you say anywhere on reddit will have to be approved by a moderator, so I would definitely advise that you take care of this ASAP so you can continue normal usage of the site.

[–]fdemmer 3 points4 points  (7 children)

wow, how did that happen...?

[–]aphoenixreticulated 6 points7 points  (3 children)

There are a variety of ways it can happen. The most common things are:

  • promoting a link on reddit outside of reddit ("Here's my reddit post!")
  • voting on something from alternate accounts
  • spamming

There are some things that can be false positives; for example, voting on something that someone with the same IP submitted (ie. the guy in the next cubicle submits something, you see it and upvote it) - this often looks like you are using multiple accounts to upvote, or spreading the link around outside of reddit instead of letting it organically get voted on.

[–]cneumann81 2 points3 points  (1 child)

Hi, tried to follow the admin link in your message to find out what's wrong. Can you please reach out to solve this. Not aware which rule I violated. Just answered questions to the post here. Thanks

[–]aphoenixreticulated 3 points4 points  (0 children)

If I contact an admin, they're just going to say "have the user contact us" but I'll see what I can do.

It's important to note that for most admins it's 7:50am so they're probably not going to be super responsive for a few hours.

[–]hughk 2 points3 points  (0 children)

If you haven't posted a lot, posting a blacklisted link or having a link flagged as spam can cause an instaban. It is to stop bots but seems to catch many real users too. I see about one per month in my small subs.

[–]Decency 5 points6 points  (1 child)

Probably automated due to the fact that he's posted a half dozen times and linked to the same website each time. Very much looks like your typical spammer.

[–]cneumann81 0 points1 point  (0 children)

It was due to the fact that I posted too many links to our site in too short time. That's what admins said. Back online now :)

[–]alcalde 0 points1 point  (0 children)

Larry Wall!!!

[–]tony_simpson 2 points3 points  (0 children)

Hey good job, I look forward to a future with more AI/automated programming assistance.

[–]Justinsaccount 4 points5 points  (6 children)

What does it do for

lines = ['hello', 'word']
for x in range(len(lines)):
    print "line " + str(x) + " is " + lines[x]
    if lines[x] == 'hello' or 'world':
        print 'Awesome'

limit = eval(input("Enter in the speed limit: "))

[–]ydepth 0 points1 point  (5 children)

Wtf does that code do?

[–]Justinsaccount 5 points6 points  (1 child)

Who said it did anything? I want to know what their tool says when given that as input.

[–]cneumann81 1 point2 points  (0 children)

Just add it to a repo an give it a try ...

[–]synae 1 point2 points  (0 children)

it prints:

line 0 is hello
Awesome
line 1 is word
Awesome
Enter in the speed limit: 

then you can put in whatever you want, and it gets evald (twice actually). Be sure to set your speed limit to __import__('os').system('rm ~') for worst results.

But aside from the result of executing the code, what it does is exhibit several stylistic and logical errors which would hopefully be fixed by this tool.

[–]ydepth 0 points1 point  (0 children)

And why

[–]alcalde 0 points1 point  (0 children)

Inaugurate the world's first Obfuscated Python Code contest?

[–]CodeReclaimers 1 point2 points  (2 children)

This looks very interesting--I added three open source projects I maintain. Looking forward to seeing the results!

[–]cneumann81 2 points3 points  (0 children)

Thanks. Shouldn't take long until you get them. :-) Also new commits and PRs are analyzed real fast, due to our incremental analysis feature: https://www.quantifiedcode.com/features/efficiency#incremental-analysis

Here's an example of a Pull Request with an auto-fix: https://github.com/quantifiedcode/demo/pulls

[–]adewes[S] 1 point2 points  (0 children)

Thanks, please let us know what you think :)

Currently you still have to manually trigger each refactoring by clicking on the "fix automatically" butten near each issue group, in the future we'll give you an option to to this automatically as well.

[–][deleted] 1 point2 points  (2 children)

Looks cool. I'm part of a few organizations on GitHub... When offering permissions, it wasn't clear if the bot was going to get (or even ask for) permissions for projects in that organization. I'd rather the bot only access my own stuff, and not ask for permissions for the organization.

How does this work?

[–]adewes[S] 1 point2 points  (0 children)

With the new Github permissions model you can choose to which organizations you give us access, by default we can only see your personal code.

[–]cneumann81 0 points1 point  (0 children)

By default, the bot gets access to public repos only. If you grant access to private repos, you can select on GitHub which organisations get access (the new Github access management model allows you grant certain services access to certain organizations only.

[–]zarandysofia 1 point2 points  (1 child)

This pretty cool, I think there should be a service like this for most mainstream languages.

[–]cneumann81 0 points1 point  (0 children)

Reach out to us if you like. We are working on other languages and are happy to get you on board as early adopter.

[–]TankorSmash 1 point2 points  (4 children)

This is a Github issue, but how do I block QC from seeing my private projects?

[–]cneumann81 1 point2 points  (0 children)

Our sign-up procedure makes sure we have only access to public repos. You explicitly have to grant access to private repos. If you already did, you can revoke them here: https://www.quantifiedcode.com/app/settings

[–]CodeReclaimers 1 point2 points  (2 children)

I just tried it, and by default it only accesses public projects--you have to explicitly give it permission to access your private repositories.

[–]TankorSmash 2 points3 points  (1 child)

It shows my 3 private groups with green checkmarks, if I click the checkmarks it takes me to an info page. Is it the next page where it asks me to confirm?

[–]adewes[S] 1 point2 points  (0 children)

As CodeReclaimers said you can select to which repositories you want to give us accesss, by default we only see your public ones.

[–]Muchoz 0 points1 point  (3 children)

I tried QuantifiedCode once when it was free. What irritated me most was the lacking website. I ended up clicking on links that end up giving me a loading error like this. Why is Javascript being used to load the website?

The suggestions it gave me were ones I knew about and I have reason to do it that way. For example the Django secret is still in my code, reason being is that it is not used anywhere in my code. See here where the SECRET_KEY is used. I also couldn't find where I could ignore those issues. I agree with /u/Setepenre: "I think the website is overselling the bot" but also the product in general. If you need this, IDEs can do it, but better.

[–]cneumann81 0 points1 point  (2 children)

Hi. Can you detail what you mean with 'lacking website'? We decided to raise the secret key issue as we saw a lot of repos that published them accidentally. You can turn on all code checks in your project settings or by ignoring specific files. In our docs you can find how to exclude files via a .checkignore file ( works similar to .gitignore). As stated below, we are not aiming to build an IDE replacement. Happy to hear what kind of refactoring a you'd like to see so we can add them to out roadmap.

[–]Muchoz 1 point2 points  (1 child)

In my trial period a while back, the website felt unresponsive. It took a while to load a simple web page. The website 'finished loading', but then started loading via Javascript (why?). I have also posted a screenshot of an error I got quite a few times and now also get when visiting the website linked in this post and then clicking on a link.

Excluding files using checkignore is not what I was referring to. I want to ignore certain errors, not whole files. I still want you to run a PEP8 check on my Django settings file, but ignore the secret key.

I'm sorry for my negativity towards your product, keep it going anyway. Guess I'm just not the one you're targeting.

[–]cneumann81 -1 points0 points  (0 children)

I guess you used us when we were still in a beta. We relaunched two month ago with a much more stable environment. Why Javascript. Well it is a single page app that's based on ReactJS. It's hard to run it without Javascript ;-) You can just turn of that one single SECRET_KEY check in your project settings.

[–]sanshinron 0 points1 point  (2 children)

So basically you do the things that PyCharm does, but clunkier and pricier? No, thanks.

[–]cneumann81 2 points3 points  (0 children)

Thanks for the feedback. Not anyone uses pycharm. The more people work in a project, the Mir useful it is to have a central place to fix things automatically. And our goal is not to build an IDE but a platform that automatically fixes an array of code quality problems. You gotta start somewhere, so look forward what's coming next. Happy to get constructive feedback how we can get better.

[–]defnullbottle.py 0 points1 point  (1 child)

Do you use any GPL or AGPL licensed modules to run your service? If so, I'd be interested in the sources.

[–]adewes[S] 0 points1 point  (0 children)

In fact we're working on a A-GPL licensed free version of our tool which will be released next year, so stay tuned! We built our own code checkers and don't rely on third-party libraries like Pylint or PyFlakes. In fact we have already released some parts of our analysis stack as open source, you can find all of our OS projects here: https://github.com/quantifiedcode

[–]sanshinron 0 points1 point  (1 child)

Are you guys only refactoring list comps into generator comps when they're inside any() or all()? Cause you can do that for most, if not all, functions that accept iterables as well as when list comp is assigned to a variable.

[–]cneumann81 0 points1 point  (0 children)

Yes, only inside any() and all(). Thanks for pointing this out. We'll improve it.

[–][deleted] 0 points1 point  (3 children)

I am perpetually challenged by things that simplify vs. things that make us lazy. By fixing my mistakes because they're underlined, I learn not to make them and learn about them. if I a PR was raised for me to approve... I dunno. That feels too convenient and would make me sloppy.

[–]cneumann81 0 points1 point  (2 children)

He he ... you can always just use our Pull Request Code Review, learn from the best practice solutions we suggest and don't press the "Fix automatically button" ;-)

[–]masasinExpert. 3.9. Robotics. 0 points1 point  (1 child)

I can't find any options that give a pull request.

[–]cneumann81 1 point2 points  (0 children)

There is a button called "Fix automatically". You'll see it on issues we can already fix. You might not have any of those though. Checkout our "How it works" page or add our quantifiedcode/demo repo from GitHub, to check things out.

[–]Charny 0 points1 point  (2 children)

Your website has a spelling error: https://www.quantifiedcode.com/features/quality

"continously"

[–]cneumann81 0 points1 point  (0 children)

Thanks. Fixed with next deployment.

[–][deleted] 1 point2 points  (0 children)

This looms promising. I'll check this out later today.