Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Avoid having more than 5 arguments in the Method:'{0}'

Avoid having more than 5 arguments in the Method:'{0}'

Scheduled Pinned Locked Moved C#
helptutorial
14 Posts 8 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P preetej

    hi, i am developing custom rules according to our company coding standard being a fresher i m not familiar with this thing i dono how to write code for this particular subject. have to write rule in cs file n implement these rules in Fxcop and have to analize error according to it.how to write code for avoid having more than 5 arguments in the method. atleast tell me how to write 5 aguments in the method.

    C Offline
    C Offline
    Christian Graus
    wrote on last edited by
    #2

    preetej wrote:

    atleast tell me how to write 5 aguments in the method.

    Wow - do you know how to program at all ? void method( int i1, int i2) ths metod has 2 arguments.

    Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

    V R P 3 Replies Last reply
    0
    • C Christian Graus

      preetej wrote:

      atleast tell me how to write 5 aguments in the method.

      Wow - do you know how to program at all ? void method( int i1, int i2) ths metod has 2 arguments.

      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      V Offline
      V Offline
      Vikram A Punathambekar
      wrote on last edited by
      #3

      I don't think that's what he meant to say. He wants to write a custom rule that yells at you if you create a method with 5 or more parameters.

      Cheers, Vikram.


      The hands that help are holier than the lips that pray.

      C 1 Reply Last reply
      0
      • P preetej

        hi, i am developing custom rules according to our company coding standard being a fresher i m not familiar with this thing i dono how to write code for this particular subject. have to write rule in cs file n implement these rules in Fxcop and have to analize error according to it.how to write code for avoid having more than 5 arguments in the method. atleast tell me how to write 5 aguments in the method.

        E Offline
        E Offline
        Expert Coming
        wrote on last edited by
        #4

        Not sure what you are wanting, but if you mean you want to check to see if a .cs file has any methods with more than 5 parameters, it shouldn't be that hard. Open the file, parse it out for methods, count the parameters. Is this your first project?

        The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo

        P 2 Replies Last reply
        0
        • P preetej

          hi, i am developing custom rules according to our company coding standard being a fresher i m not familiar with this thing i dono how to write code for this particular subject. have to write rule in cs file n implement these rules in Fxcop and have to analize error according to it.how to write code for avoid having more than 5 arguments in the method. atleast tell me how to write 5 aguments in the method.

          L Offline
          L Offline
          laserbaronen
          wrote on last edited by
          #5

          I wrote some FxCop rules last year, and if i remember it correct you should override the

          Problem[] Check(Method myFooBarMethod2k)

          ... there should be some kind of parameter list in myFooBarMethod2k that you can use


          betonglasermur.FeedDwarf(pur_is, 17);
          ProcessStartupInfo.AintNotCreateNoWindow = (false && !true) != (true || false) ? false == true ? true : false : (true != false && false);

          Morgonen är tröttmans mecka

          1 Reply Last reply
          0
          • C Christian Graus

            preetej wrote:

            atleast tell me how to write 5 aguments in the method.

            Wow - do you know how to program at all ? void method( int i1, int i2) ths metod has 2 arguments.

            Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

            R Offline
            R Offline
            Ravenet
            wrote on last edited by
            #6

            nice explanation

            Cheers,Earn and Enjoy RRave MCTS,MCPD http://ravesoft.blogspot.com

            1 Reply Last reply
            0
            • P preetej

              hi, i am developing custom rules according to our company coding standard being a fresher i m not familiar with this thing i dono how to write code for this particular subject. have to write rule in cs file n implement these rules in Fxcop and have to analize error according to it.how to write code for avoid having more than 5 arguments in the method. atleast tell me how to write 5 aguments in the method.

              R Offline
              R Offline
              Ravenet
              wrote on last edited by
              #7

              Hi User Codeprovider in .net check method information with runtime for more information please check in msdn.

              Cheers,Earn and Enjoy RRave MCTS,MCPD http://ravesoft.blogspot.com

              1 Reply Last reply
              0
              • P preetej

                hi, i am developing custom rules according to our company coding standard being a fresher i m not familiar with this thing i dono how to write code for this particular subject. have to write rule in cs file n implement these rules in Fxcop and have to analize error according to it.how to write code for avoid having more than 5 arguments in the method. atleast tell me how to write 5 aguments in the method.

                S Offline
                S Offline
                sarvesh upadhyay
                wrote on last edited by
                #8

                Hi you can check this link http://weblogs.asp.net/pglavich/archive/2005/07/19/419869.aspx[^]

                Sarvesh Upadhyay Senior Software Engineer Birlasoft India Ltd. Microsoft Certified Professional Developer in Dotnet 2.0 Enterprise Application

                1 Reply Last reply
                0
                • P preetej

                  hi, i am developing custom rules according to our company coding standard being a fresher i m not familiar with this thing i dono how to write code for this particular subject. have to write rule in cs file n implement these rules in Fxcop and have to analize error according to it.how to write code for avoid having more than 5 arguments in the method. atleast tell me how to write 5 aguments in the method.

                  S Offline
                  S Offline
                  sarvesh upadhyay
                  wrote on last edited by
                  #9

                  here you can get a working example. http://www.binarycoder.net/fxcop/html/index.html[^]

                  Sarvesh Upadhyay Senior Software Engineer Birlasoft India Ltd. Microsoft Certified Professional Developer in Dotnet 2.0 Enterprise Application

                  1 Reply Last reply
                  0
                  • E Expert Coming

                    Not sure what you are wanting, but if you mean you want to check to see if a .cs file has any methods with more than 5 parameters, it shouldn't be that hard. Open the file, parse it out for methods, count the parameters. Is this your first project?

                    The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo

                    P Offline
                    P Offline
                    preetej
                    wrote on last edited by
                    #10

                    ya this is my 1 st project so i m confused like what to do

                    1 Reply Last reply
                    0
                    • C Christian Graus

                      preetej wrote:

                      atleast tell me how to write 5 aguments in the method.

                      Wow - do you know how to program at all ? void method( int i1, int i2) ths metod has 2 arguments.

                      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                      P Offline
                      P Offline
                      preetej
                      wrote on last edited by
                      #11

                      sorry i m new to programming so only i m in need help of you people.i dont know to program that good.

                      1 Reply Last reply
                      0
                      • E Expert Coming

                        Not sure what you are wanting, but if you mean you want to check to see if a .cs file has any methods with more than 5 parameters, it shouldn't be that hard. Open the file, parse it out for methods, count the parameters. Is this your first project?

                        The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo

                        P Offline
                        P Offline
                        preetej
                        wrote on last edited by
                        #12

                        s this is my first assignment in the company

                        1 Reply Last reply
                        0
                        • P preetej

                          hi, i am developing custom rules according to our company coding standard being a fresher i m not familiar with this thing i dono how to write code for this particular subject. have to write rule in cs file n implement these rules in Fxcop and have to analize error according to it.how to write code for avoid having more than 5 arguments in the method. atleast tell me how to write 5 aguments in the method.

                          P Offline
                          P Offline
                          PIEBALDconsult
                          wrote on last edited by
                          #13

                          Limiting the number of parameters to methods seems like an odd idea. However, I think some clarification is needed; by the '{0}' in the subject, do you mean limiting the number of parameters passed to things like string.Format and Console.WriteLine?

                          1 Reply Last reply
                          0
                          • V Vikram A Punathambekar

                            I don't think that's what he meant to say. He wants to write a custom rule that yells at you if you create a method with 5 or more parameters.

                            Cheers, Vikram.


                            The hands that help are holier than the lips that pray.

                            C Offline
                            C Offline
                            Christian Graus
                            wrote on last edited by
                            #14

                            I took it to mean that at the end he said he doesn't even know what the rule means. It's clear he doesn't know much about programming in general from his responses.

                            Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                            1 Reply Last reply
                            0
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • World
                            • Users
                            • Groups