OOP code review

Hi,
Can anyone help me on checklist for a OO-ABAP prog code review?
Thanks.

Hi,
Here are some. I dont have a link and site which can give u all that.
Shall give a few points here:
1. The nesting of IF statements should be limited.  When multiple conditions are being tested, the appropriateness of the CASE statement should be considered
2. The CASE statement uses WHEN OTHERS
3. When possible, do not use the TRANSLATE statement, because it is not efficient.
4. Always specify your conditions in the Where clause instead of checking
5. SELECT INTO preferred to SELECT
6. Avoid select * to the max.
7. Use primary key while selecting.
8. Avoid nested selects and nested loops
9. Avoid the use of the ORDER BY clause on a SELECT statement that sorts by non-indexed fields. 
10. SORT ITAB ORDER BY preferred over SORT ITAB
11. Use multiple MOVE statements instead of a single MOVE-CORRESPONDING statement.
12. LOOP…WHERE is prefered to LOOP/CHECK
13. use binary search while readin
14.      Itab2[] = Itab1[] is preferred to
     Loop at Itab1.
     Itab2 = Itab1.
     Append Itab2.
     Endloop.
15. use DESCRIBE instead of COUNT
Hope these will help you your review process.
Also check out this link:
http://www.sap-basis-abap.com/abap/abap-4-development-code-efficiency-guidelines.htm
http://www.ams.utoronto.ca/userfiles/page_attachments/Library/1/Developmentstandards_guidelines_335678.pdf
Best Regards,
Anjali

Similar Messages

  • ABAP Code Review

    Hello Experts--
    I have query where I will require your expert comments. I would like to check the quality of ABAP code with reference to
    (a) Program logic
    (b) Performance issues
    (c) Table joint
    (d) Buffer being used
    (e) Index etc etc
    Is there any tool in SAP or any third party tool which can help to check the quality of code.
    Thanks in advance for your reply.
    Regards
    --Anshuman

    Dear Anshuman,
    Look at the transaction code SCI- Code Inspector and SLIN- Extended program Check - These both together will definitely help you in to a large exten check in your code review and which can help to check you ABAP Code Quality.
    There also can be some obsolete statements which need to be take care of and also some SQL queries which are not longer supported in OOPs context.
    So hope this will help you to a lot extent in determining the Quality Code.
    There are additional Transactions like SE30, ST05 which may help you to know about the performance or time consumption of your programs as such.
    Hope this too helps you.
    Encourage others to answer you queries by suitably rewarding them
    Thanks
    Venugopal

  • What are the major issues to consider in code review? Or performance analys

    What are the major issues to consider in code review? Or performance analysis?

    I would not recommend you to try to optimize performance by checking the coding.
    There is the code inspector which can do all which makes sense automatically.
    The above mentioned points are not the real issues.
    Instead of code review you should execute test cases and measure the exection time.
    1. With STAD if you want to get good time measurement
    2. With SE30 and ST05, if you want to have data for further anaylsis.
    Check total time (SE30), check whether DB part is large, then go to SQL trace. Do the check mentioned here
    /people/siegfried.boes/blog/2007/09/05/the-sql-trace-st05-150-quick-and-easy
    to find the SQL bottlenecks.
    The major point about SQL problems is index support, if there is no proper index support then the performance will be poor. Be aware, that problems are only visible, if you tables are filled.
    In a test system where you have very little data, you will never encounter performance problems.
    Check also the Top10 of the SQ30 hit list.
    Be aware that a proper performance analysis is not a 5 minutes job.
    Siegfried

  • Are there any good tool for checking security risks, Code review, memory leakages for SharePoint projects?

    Are there any good tool for checking security risks, Code review, memory leakages for SharePoint projects?
    I found one such tool "Fortify" in the below link. Are there any such kind of tools available which supports SharePoint?
    Reference: http://www.securityresearch.at/en/development/fortify/
    Amalaraja Fernando,
    SharePoint Architect
    Please Mark As Answer if my post solves your problem or Vote As Helpful if a post has been helpful for you. This post is provided "AS IS" with no warrenties and confers no rights.

    Hi Amalaraja Fernando,
    I'm not sure that there is one more tool that combines all these features. But you may take a look at these solutions:
    SharePoint diagnostic manager
    SharePoint enterprise manager
    What is SPCop SharePoint Code Analysis?
    Dmitry
    Lightning Tools Check
    out our SharePoint tools and web parts |
    Lightning Tools Blog | Мой Блог

  • Post Commit code Review Linking in the TFS Warehouse

    Hello
    I am having problems trying to find code reviews associated with a change set where the review and been after checkin. So the reviews are generated by History view --> double click on the changeset --> Actions --> Request Review.
    I understand that when its from a changeset (post-checkin), there is only a link from the code review to the changeset and nothing between the Changeset and the code review.  However when I am looking through the TFS Warehouse I cannot find any table holding
    the link between the code review and the changeset. I expected it to be in the FactWorkItemChangeset but its not there. 
    Is this possible from the TFS Warehouse? 
    Thanks for looking.

    Hi SimonAzurec,  
    Thanks for your post.
    Currently, we can only double click on the changeset to check which code review(s) linked to this changeset in Team Explorer. Please refer to the screenshot in this post:
    http://stackoverflow.com/questions/14103788/tfs-2012-how-can-i-tell-if-a-changeset-was-code-reviewed. 
     After you checked in, please open the linked Code Review Request work item in VS, you will find there’s no changeset shows under
    LINKS table.    
    For this scenario, please submit it to User Voice site at:
    http://visualstudio.uservoice.com/forums/121579-visual-studio. Microsoft engineers will evaluate them seriously.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Code Review Tool - Ignore Whitespace

    When I view the comparison in the code review tool ignore whitespace is on by default. The problem is that it doesn't ignore all whitespace. For example, a method's parameters prior to the change had a space between the start and end of the parameter definition
    but after changes the auto format of visual studio is different by removing the spaces (different user preference).The code review tool see's this as a difference. Why is that? 
    Before:
    public class test
    public TestMethod( string testString )
    After
    public class test
    public TestMethod(string testString)
    This is very frustrating because the very nice visual difference bar to the right of the code comparison becomes useless in these situations. 

    Hi Zpittman,
    What is you said ‘Code Review Tool’?
    I assume that you meant the Code Review feature in TFS. I tried it in Visual Studio 2013 with update 4 and TFS 2013 with Update 4, the whitespace was detected and the code review see it as a difference.
    If you don’t get the same result with me using VS and TFS, please upgrade your VS and TFS to the latest update.
    If the issue still exists, please
    reset your VS settings through Tools->Import and Export settings->Reset all
    settings->…. and repair your VS.
    If code review tool is a third-party tool or a third-party VS/TFS add-in, the official support of this tool can be a better place to resolve your issue.
    If I misunderstood anything, please feel free to come back.
    Thanks,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Looking for Code Review Resources

    We have completed a complex project using jakarta struts and are in beta testing at the moment.
    Would like to have someone review our code but we have not been able to find expierienced developers in our (physical) area.
    Does anyone have suggestions on where I could look to find a qualified individual for independent code review.
    Thank you in advance for your suggestions.

    Just post it here. Some of our fine reviewers will be happy to serve you.
    P.S. Be sure to say that it's homework.

  • [svn:osmf:] 14261: Updated DRM unit tests to work with code review feedback .

    Revision: 14261
    Revision: 14261
    Author:   [email protected]
    Date:     2010-02-18 14:15:23 -0800 (Thu, 18 Feb 2010)
    Log Message:
    Updated DRM unit tests to work with code review feedback.
    Modified Paths:
        osmf/trunk/framework/OSMFTest/org/osmf/elements/TestParallelElementWithDRMTrait.as
        osmf/trunk/framework/OSMFTest/org/osmf/elements/TestSerialElementWithDRMTrait.as
        osmf/trunk/framework/OSMFTest/org/osmf/traits/TestDRMTrait.as
        osmf/trunk/framework/OSMFTest/org/osmf/utils/DynamicDRMTrait.as

    Hello Alex,
    I don't have an answer for you.
    But, can you try to use http://drmtest2.adobe.com:8080/Content/anonymous.f4v with locally hosted OSMF player? This content doens't require user/pass info.
    I'm wondering that Google TV's flash player doesn't support prompt dialog.
    http://drmtest2.adobe.com/AccessPlayer/player.html requires flash player 11. That's why it won't be loaded with flash player 10.x.
    Thanks,
    -- Hiroshi

  • Code Review

    Hi folks,
    need your assistance here; an example, I gave you a sql statement of almost 20 lines, with so many joins/hint and a lot of other activities too.
    And you've been asked to review that code and provide your input/thoughts/suggestion/advises about this code.
    What'll be your approach, how you'll go about it?
    Statistics are already gathered for all the objects, now what'll be your steps and how you'll take care of this task, please try to explain in a step by step way.
    Thanks in advance.

    Let's take a step back... What is the goal of your code review?
    Are you reviewing the code to see if it returns the expected results? If so, you'd need to understand the requirements, your data model, etc.
    Are you reviewing the code to see if it reuses other code effectively? If so, are there existing views that join several of these tables with the same conditions that could be used so that if the conditions change in the future you only have to update one view rather than hundreds of queries? Are there functions that compute data that you are computing in the query? Are there negative performance implications to using those existing views or functions because, for example, they also join in additional tables that you don't need (note that in very recent versions, Oracle may be able to eliminate those joins)? If so, you'll need to examine whether the benefits of code reuse outweigh the cost of slighly slower performance.
    Are you reviewing the code to see if it follows your organization's standards? Does your organization have standards about SQL 99 join syntax versus older join syntaxes, for example? Does it have standards about how to alias tables in the query or how to indent the code or anything else that an organization might standardize on?
    Are you reviewing the code to examine the performance? If so, what criteria are you using? A code review implies that this is something you're doing before code goes to production. Normally, the developers would have verified performance in the lower environments by doing load tests on representative volumes of data to compare performance against whatever the
    requirements laid out as acceptable. Perhaps it makes sense to compare the query plan generated in production against the query plan that was verified as performing adequately in the lower environments in order to ensure that the performance isn't going to radically degrade when the query runs in production. Perhaps it makes sense to pull an AWR from the test environment from the period during the load test and to review the top SQL statements on that report if they are new. It generally doesn't make sense to try to review the query plan of every query before it goes to production if the developers haven't done the basic level of performance testing in advance-- no one is going to, in general, be able to look at a query plan and give you a "thumbs up" or a "thumbs down" with no context, no requirements, and no background. At most, you could look for yellow flags-- query plans that involve hitting every partition in a table rather than doing partition pruning, queries that return a single row that do table scans rather than using an expected index, queries that return millions of rows that use an index rather than an expected table scan-- in order to figure out what queries are worth focusing on.
    Justin

  • Code Reviewing stored procedures

    Hi team,
    Is there any shortcut way to code review stored procedures in sql.
    Note: Condn. need to check are below
    Checking whether all temp tables dropped, if its not dropped then to identify that table
    checking update and delete statement on physical table which should include PRIMARY KEY column in where condition
    checking Every JOIN stmt shouldn't combine more than five physical tables
    Checking any temp table created like select * into #table from some physical table
    Checking any physical table creation during run time of Sp
    Thanks in advance
    Regards, Muthukumar Balu

    Hi all,
    Following function gives the create tmp table and drop temp table stmt in row wise.Hence we can count the create tmp tables and drop tables.   Count will identify the missing drop tables ,Like this am asking shortcuts for code reviewing.
    ===========================================
    Create FUNCTION [dbo].[uftReadfileAsTable]
    @Path VARCHAR(255),
    @Filename VARCHAR(100)
    RETURNS 
    @File TABLE
    [LineNo] int identity(1,1), 
    line varchar(8000)) 
    AS
    BEGIN
    DECLARE  @objFileSystem int
            ,@objTextStream int,
    @objErrorObject int,
    @strErrorMessage Varchar(1000),
       @Command varchar(1000),
       @hr int,
    @String VARCHAR(8000),
    @YesOrNo INT
    select @strErrorMessage='opening the File System Object'
    EXECUTE @hr = sp_OACreate  'Scripting.FileSystemObject' , @objFileSystem OUT
    if @HR=0 Select @objErrorObject=@objFileSystem, @strErrorMessage='Opening file "'+@path+'\'+@filename+'"',@command=@path+'\'+@filename
    if @HR=0 execute @hr = sp_OAMethod   @objFileSystem  , 'OpenTextFile'
    , @objTextStream OUT, @command,1,false,0--for reading, FormatASCII
    WHILE @hr=0
    BEGIN
    if @HR=0 Select @objErrorObject=@objTextStream, 
    @strErrorMessage='finding out if there is more to read in "'+@filename+'"'
    if @HR=0 execute @hr = sp_OAGetProperty @objTextStream, 'AtEndOfStream', @YesOrNo OUTPUT
    IF @YesOrNo<>0  break
    if @HR=0 Select @objErrorObject=@objTextStream, 
    @strErrorMessage='reading from the output file "'+@filename+'"'
    if @HR=0 execute @hr = sp_OAMethod  @objTextStream, 'Readline', @String OUTPUT
    INSERT INTO @file(line) SELECT @String
    END
    if @HR=0 Select @objErrorObject=@objTextStream, 
    @strErrorMessage='closing the output file "'+@filename+'"'
    if @HR=0 execute @hr = sp_OAMethod  @objTextStream, 'Close'
    if @hr<>0
    begin
    Declare 
    @Source varchar(255),
    @Description Varchar(255),
    @Helpfile Varchar(255),
    @HelpID int
    EXECUTE sp_OAGetErrorInfo  @objErrorObject, 
    @source output,@Description output,@Helpfile output,@HelpID output
    Select @strErrorMessage='Error whilst '
    +coalesce(@strErrorMessage,'doing something')
    +', '+coalesce(@Description,'')
    insert into @File(line) select @strErrorMessage
    end
    EXECUTE  sp_OADestroy @objTextStream
    -- Fill the table variable with the rows for your result set
    RETURN 
    END
    ==================================================
    steps to check:
    1. Execute the function n ur DB
    2. Store your sql file in some location.
    3. Execute following query in ur DB and path should be replaced with where u have stored ur SQl file
    --QUERY
    Select line from
     Dbo.uftReadfileAsTable('D:\SQL_CODE_REVIEW','filename.sql')
    where line  like '%create%table%#%'
    Select line from
     Dbo.uftReadfileAsTable('D:\SQL_CODE_REVIEW','filename.sql')
    where line  like '%drop%table%#%'
    Regards, Muthukumar Balu

  • Oracle Apps secure code review

    Is any documentation available (either Oracle or third party based) to guide secure code reviews for Oracle Apps (or more specifically, Oracle Application Framework)?
    I'm aware of the usual sql injection bad practices (as related to JDBC and PLSQL). I'm curious about API abuse, as related to:
    - cross-site scripting concerns
    - client-side trust issues (e.g., hidden field values)
    - improper or inconsistent input validation
    - improper error handling
    - improper session management
    - inappropriate access control
    Thanks.

    Thanks... I looked at that and didn't think it was all in there, but I looked again after I got your reply and it appears to be what we are looking for (at least a starting point).

  • Web Code Review - How do you complete it?

    We have been using VSO and VS2013 for a while now and can happily complete code reviews in visual Studio. The code review email offers a link to perform the code review online via Web Access. I can open the review and see all the changes but I cannot find
    how to complete with an outcome eg "Looks Good" - is this possible?

    Forgotten RESTRICTIONS Passcode
    - Place the iOS device in Recovery Mode and restore via iTunes. For how to restore: iTunes: Restoring iOS software
    You have to either:
    - Restore from a backup that was make before you added the Restrictions passcode. If you restore from a backup made with the Restrictions passcode the Restrictions passcode is also restored.
    - Restore to factory settings/new iPod

  • Need clarification from experts regarding few code review comments received

    Hi,
    I know that this is a very trivial question to post onto in here but just wanted to double check with all the experts out there. I was lately given few code review comments by one of the senior developers in my project which I couldnt completely agree upon. I thought to seek further inputs from the experts out here.
    1) Consider the SQL query below:
    SELECT  orgeh orgtx FROM t527x INTO TABLE ch_org_unit_descs
                   FOR ALL ENTRIES IN ch_org_unit_list WHERE sprsl = gc_english AND
                                                             orgeh = ch_org_unit_list-orgeh AND
                                                             endda = gc_endda.
    I was instructed not to pass any constant values (like how am passing to SPRSL & ENDDA) as shown above. The code reviewer said that this would result in poor performance & that am supposed to perform a DELETE upon the resulting internal table instead. I did try read around & search the available documentation but could not come up with any similar note anywhere. Can the experts please comment on the credibility of this statement?
    2) Also say I am writing a CASE statement then if I say as WHEN 'ATT' does this mean that am hard coding 'ATT' and that I should have gone for a constant instead? Whilst the code reviewer said that I was hard coding text  I would have to admit that I haven't ever declared a constant for handling any of the WHEN statements in any of my projects till date. Is this a bad practice from my end or do you think its like imposing double standards?
    Regards,
    Uday

    I second both Sandra & Rob on their views on FAE. As Rob has suggested do a runtime analysis or SQL trace and compare the DB execution times.
    >
    Sandra Rossi wrote:
    > We should use a constant when a value is often used or when a name is better than just a meaningless value.
    Using constants for any literal used in the code makes it difficult to understand. I have seen codes with something like CALL TRANSACTION c_fb01 or AUTHORITY OBJECT c_s_dataset.
    I always make it a point to declare constants for organizational or functional values which might change in future. Declaring constants for elements which are specific to my code is definitely a NO-NO for me. Comments are welcome on this.
    BR,
    Suhas

  • Code Review:: ADF BC applications

    Hi,
    We would like to know if there's any open source software available for code reviews of ADF applications and how to effectively use to for ADF BC applications?
    1) Am I moving in right direction while exploring PMD and Checkstyle? Are these the right candidates for setting automated code reviews for ADF applications?
    Is there a specific software recommendation by the forum members which can help me achieve this goal.
    2) Can CodeCoach and Audit features available in JDeveloper help me in this?
    3) Will I have to necessary create 'Custom Rules' for tasks like validating EO classes are not directly referred in the Controller? Are there some pre-built rule-sets available on this front?
    4) Any other suggestions for ensuring better/faster code reviews not necessarily replacing the manual peer review process but reducing the unnecessary headaches that can be fixed by freely available software
    Sid

    I started using ADFLogger and added some log statements. When I ran my application in JDeveloper in Embeded OC4J server, these log statements are appearing in JDeveloper server log window. After I deployed this application to Oracle Application Server, these statements are not appearing in the application.log file and also not in any file. Am I missing any configuration setting? The log current level is INFO and I do have few INFO statements, SEVERE statements in my code. Thanks in advance.

  • Jupiter Plug-in for JDeveloper for doing effective code reviews?

    Hi all,
    Can some body comment on the availability of an effective code review tool that can be used with -
    a) JDeveloper as a IDE and
    b) Can work with ADE as a version control tool?
    My team is currently trying to understand if Jupiter, which is an Eclipse based plug-in, can serve as a possible solution for the same.
    Request you all to answer a) and b) w.r.t Jupiter and also suggest alternatives, if any.
    Regards,
    Prasad.

    What type of review are you looking for?
    JDeveloper has built in code review see (Run->audit project).
    There is also a PMD extension to JDeveloper.
    If you are looking for a tool that will let you track things to fix in your code among team members have a look at Oracle's Team Productivity Center:
    http://www.oracle.com/technology/products/tpc/index.html

Maybe you are looking for

  • Can you purchase from the app store with someone else's appleid?

    My grandson has his own iPhone.  He uses it to play APPS.  He has his own AppleID. His father downloaded a new game using his own AppleID onto his son's iPhone. My grandson's iPhone now seems to be confused as to what AppleID it belongs to? When an A

  • Looking for note pad app

    My boyfriend will be leaving for med school at the end of next month. I want to get him an iPad as a gift but before I buy it I want to know if there is an app that will work with a stylus for note taking. Specifically, I would like him to be able ta

  • HP Slate 500 - HDMI To Projector (mini-HDMI)

    From HP Slate 500, I connected to Optoma PK301 projector, using the HDMI output port in the Slate's Dock. I am not seeing any video output in the projector. The Projector mini-HDMI is working good, I can see proper video output when connected to HDMI

  • HT5312 how to reset my security questions ? I forgot it

    Hi I am Ibrahim From Iraq, I forgot my security questions and I can't purchase anything, can you please to tell me how I can to reset again ?

  • Strange Problem with a Vector wraped inside a Hashtable

    Hi all , I'm having a strange problem with a Vector wraped within a Hashtable inherited Class. My goal is to keep the order of the elements of the Hashtable so what I did was to extend Hashtable and wrap a Vector Inside of it. Here is what it looks l