Console.WriteLine -> redundancy

2 posts, 0 answers
  1. Wolfgang
    Wolfgang avatar
    98 posts
    Member since:
    Oct 2012

    Posted 24 Jul 2013 Link to this post

    Hi, 
    JustCode does not seem to know the format overload of Console.WriteLine().
    Therefore it tries to suggest for working code something which does not work.
    
    In the example below, Telerik shows as fix: "Move to Parameter" or "String.Format". 
    If String Format is choosen, the working one is translated 
    to a string.Format with null values.
    
    (Is there any possibility to show which rule marks a line as bad line?)
    
    Best regards,
    Wolfgang
    
    Original Code:
    
    Console.WriteLine("Value for {0} \t: {1}", somename, somevalue);
    Suggested Code by JustCode:
    Console.WriteLine(String.Format("Value for {0} \t: {1}",null,null), somename, somevalue);
  2. Zdravko
    Admin
    Zdravko avatar
    657 posts

    Posted 26 Jul 2013 Link to this post

    Hi Wolfgang,

     Thanks for the feedback.
    I successfully reproduced the issue and logged it for fixing in our system.
    Thanks.

    Regards,
    Zdravko
    Telerik
    Share what you think about JustCode with us, so we can help you even better! You can use the built-in feedback tool inside JustCode, our forum, or our JustCode feedback portal.
  3. DevCraft banner
Back to Top