Source code analysis

I've never used any tool to analyze the quality of my code, I usually just try to keep SLOC (or rather number of logical statements) as low as possible. I've found out there's Sonar, which is available in AUR, but I'm sure there are others available.
I'm mostly developing in Python, so I'm primarily looking for a tool with support for Python code. Just mentioning it since it's relevant.
But I'm more interested in how many of you use such tools and which of them do you use.

pylint and pyflakes are popular for Python.  Both check for logical errors, and are usually quite good at finding them. 
pylint also partially checks for PEP 8 conformance, and questionable or dangerous code.  For instance, it hints non-conforming names like classes starting with a lower case letter, unused variables or arguments, and constructs considered questionable by the pylint developers.  The latter includes among other things use of the builtin map and filter functions, and *args and **kwargs syntax, which is not agreed on by some Python users. You can however disable or configure warnings emitted by pylint in a very finely grained manner, and thus turn warnings of on per line, per block, per object, per file and per project basis.   By and large, pylint is used by most Python developers and projects, and more or less *the* error checker for Python code.  It is definitely recommendable, and already integrated in many IDEs (WingIDE, the Pydev plugin for Eclipse and others).
pyflakes only focuses on logical errors, and does neither check for coding style nor for "dangerous code".  It's output is consequently less verbose and it normally doesn't need any configuration.  When it comes to error checking, it is however not less recommendable than Pylint, though not as widely used among Python developers.
Concering coding style, there is another tool, named pep8, which rigidly checks for PEP 8 conformance, especially with regards to names.  PEP 8 is *the* Python style guide, and is adopted and partially enforced by many popular Python projects. If you contribute to such projects, or want to write code whose style is accepted by the vast majority of Python developers, or want to avoid nit-picky style remarks when showing your Python code in some Python forum, you may find this tool quite useful.

Similar Messages

  • Source code analysis tools for ActionScript 2?

    I have been tasked with performing source code analysis on a very large (>1000 files) AS2 codebase. 
    Not surprisingly, Googling is not yielding useful results.   Before declaring defeat, I felt it important to query this forum.
    Any guidance would be appreciated.

    We'd like to evaluate the hundreds of files using a static analysis tool, just as one would use lint for a C codebase.
    Thanks,
    M

  • Source Code Analysis tool for BPEL (and BPMN) 11g

    Hi,
    We are checking for the availablility of 'source code analysis' tools (analogy like findbug, checkstyle) for BPEL / BPMN Orchestrations.
    Any information/pointers to it is really valuable and appreciated.
    Thanks,
    Pavan.

    Hi AnujaMoharir,
    Welcome to MSDN.
    I am afraid that as Renee Culver said, these forums donot support VB6, you could refer to this thread:
    Where to post your VB 6 questions
    You could consider posting this issue in these forums below:
    These forums do not support Visual Basic 6, however there are many third-party support sites that do. If you have a VB6-related question please visit these popular forums:
    VB Forums
    VB City
    Thanks for your understanding.
    Best Regards,
    Youjun Tang
    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.

  • Java static code analysis tool on Windows

    What Java static source code analysis tool are there on Microsoft Windows, and which would you recommend?
    I Know Coverity and
    Klocwork
    Edited by: Jennifer.helen on May 8, 2009 6:03 AM

    I submit PMD and Findbugs.

  • I am running 10.6.8 and using iweb for my web site. After several SEO analysis they all indicate I need H1-6 header tags. After looking at the source code I see there are none in iweb. Is it necessary to add? If so, how do I add H Tags to iweb.

    I am running 10.6.8 and using iweb for my web site. After several SEO analysis they all indicate I need H1-6 header tags. After looking at the source code I see there are none in iweb. Are they necessary to add?  Why would one add these tags and how do I add H Tags to iweb? And are there examples to look at? I am slowly learning about simple web design and assumed that iweb was stand alone without having to write code. Is this one of the reasons iweb is no longer supported? Thanks for looking at this!

    A simple text page like this:
    Heading
        sub heading
              text paragraph ....
    Is traditionally represented by html tags like:
    <h1>Heading</h1>
         <h2>sub heading</h2>
              <p>text paragraph ... </p>
    I would guess that the use of h1-h6 tags helps search engines to understand the structure of a page as the tags imply a certain structure.
    This can be compared to more generic tags like <div> that could represent any kind of content - and may be what iWeb uses (you'll have to check yourself).
    I would generally recommend that you use some kind of up to date blog/site building tool, perhaps Wordpress or Squarespace (I haven't used either one myself) that support current web technologies - this should reduce your SEO issues and make it easier to properly support mobile/tablet users.

  • Error during analysis of source code

    Hi,
    I am trying to add a field to the search criteria and i have followed the steps as given in the cook book. I am stuck at a point where on trying to add the custom field to the existing code i get an error message - "Error during analysis of Source code". This pop up comes at the end of the wizard.
    I also tried to create a new context node but at the end of the wizard i get the pop up and the same  message inside.
    I searched in SDN and found out that this error could occur if the context node class is not active. In my case, all the three classes : Controller , context and context node class are active.
    Could some one throw some light as to why this error message occurs?
    Regards,
    Venkat

    Hi Experts,
    I'm also getting a similar error but at the time of creating a new event. All the classes are active without errors.
    How do we resolve this.
    Appreciate your help.
    Regards,
    Sandeep

  • Have any source code can produce a web traffic analysis?

    I want to get the source code to produce a web traffic analysis report, for example i input a tomcat's access_log, it can analysis this log file and then output the analysis result in html file format.
    I have already found a source code to parsing the IE's log file, but i can't find a source code to parse the tomcat's access_log file.
    Have anybody know where can download this source code.......Thank a lot!!!!!

    I also want to know how to do this........

  • Cluster Analysis source code

    Hello
    i need a source code for a cluster analysis. We planning a project at our university and we have to cluster vectors and do a visualization of a tree. If anyone know where I can find a code like this that would be great.

    Yahoo! Search
    TOP 20 WEB RESULTS out of about 2,100,000. Search took 0.16 seconds.
    1 . Cluster Analysis 
                ... The term cluster analysis ( first used by Tryon, 1939)...Thats one, I am sure you can look through the other 2,099,999...
    Have fun...
    - MaxxDmg...
    - ' I am not a number... '

  • How to use Source Code Control for Large Application?

    Hi, All!
    I would like to collect knowledge about "best practice" examples for using Source Code Control and project organization for relative large application (let's say approx 1000 SubVIs).
    Tools used:
    LabVIEW 8.0
    CVS Server
    PushOK CVS Proxy Client
    WinCVS
    With LabVIEW 8 we can organize large project pretty well. This described in article Managing Large Applications with the LabVIEW Project.
    I have read this article too: Using Source Control Software with LabVIEW In this Article Source Safe used, but with PushOK all looks nearby the same and works (some tricks for compare function are required).
    Example. Two developers working together on same project. Internally project is modular, so one developer will work with module "Analysis", and another one with "Configuration" without interferences. These modules placed into Subfolders as shown in example above.
    Scenario 1:
    Developer A started with modification of module "Analysis". Some files checked out. He would like to add some SubVIs here. So, he must also perform check out for the project file (*.lvproj), otherwise he cannot add anything into project structure.
    Developer B at the same time would like to add some new functions into module "Configuration". He also needed to check out project file, but this file already checked out by Developer A (and locked). So, he must wait until lvproj file will be checked in. Another way is mark *.lvproj files as text files in PushOK, but then one of developers will get conflict message by checking in and then merging will be necessary. This situation will coming very often, because in most cases *.lvproj file will be checked out all the time.
    Question: Which practice is better for such situation? Is Libraries better than folder for large project?
    Scenario 2:
    Developer C joined to the team. First, he must get complete project code for starting (or may be at least code of one Library, which assigned to him).
    Question: How it can be done within LabVIEW IDE? Or WinCVS (or other SCC UI) should be used for initial checkout?
    Scenario 3:
    Developer D is responcible for Build. Developers A,B,C have added lot of files into modules "Analysis", Configuration" and "FileIO". For building he need to get complete code. If our project splitted into folders, he should get latest *.lvproj first, then newly added SubVIs will appear in Project Explorer, then he should expand tree, select all SubVIs and get latest versions for all. If Project organized in Libraries, he must do the same for each library, isn't?.
    Question: Is this "normal way", or WinCVS should be used for this way? In WinCVS its possible with two mouseclicks, but I prefer to get all code from CVS within LabVIEW IDE recursively...
    That was a long post... So, if you already working with LabVIEW 8 with SCC used for large project, please post your knowledge here about project structure (Folders or Libraries) and best practices, its may be helpful and useful for all of us. Any examples/use cases/links etc are appreciated.
    Thank you,
    Andrey

    Regarding your scenarios:
    1. Using your example, let's say both developers checked out version 3
    of the project file. Assuming that there are only files under the
    directories in the example project, when Developer A checks in his
    version of the project, there will be new files in one section of the
    project separate from where Developer B is working. Developer B,
    notices that there is now a version 4 of the project. He needs to
    resolve the changes so will need to merge his changes to the latest
    version of project file. Since the project file is a text file, that is
    easy to do. Where an issue arrises is that after Developer B checks in
    his merged changes, there is a revision 5. When Developer A and B go to
    make another change, they get the latest version which will have the
    merged changes to the project file but not the referenced files from
    both Developer A and B. So when A opens version 5, he sees that he is
    missing the files that B checked in and visa versa. Here is where the
    developers will needs to manually use the source control client and,
    external to LabVIEW, get those new files.
    Where libraries help with the above scenario is that the library is a
    separate file from the project so changes made to it outside of the
    project do not require the project to be modified. So this time, the
    developers are using a single project again which time time references
    two libraries. The developers check out the libraries, make changes to
    the libraries, and then check those changes in. So when each developer
    opens the project file, since it references the project file, the
    changes to the library will be reflected. There is still the issue of
    the new files not automatically coming down when the latest version of
    the library is obtained. Again, the developers will needs to manually
    use the source control client and, external to LabVIEW, get those new
    files. In general, you should take advantage of the the modularity that
    libraries provide.
    2. As noted in the above scenario, there is no intrinsic mechanism to
    get all files referenced by a LabVIEW project. Files that are missing
    will be noted. The developer will then have to use the source control
    provider's IDE to get the initial contents of the project  (or library).
    3. See above scenarios.
    George M
    National Instruments

  • Source codes wanted

    does anybody have codes for any of the following reports?
    ·     Report for Sales Orders due for delivery.
    ·     Revenue Reports based on Order Types.
    ·     Report for list of Pending Purchase Orders, Cancel Purchase
    orders.
    ·     Interactive Report that lists out all the materials for a given
    plant. Secondary list contains Vendors who supply the chosen material.
    ·     Analyze material receipts & issues. It finds the balance of
    issued goods & received goods based on plant, storage location, and
    material in particular period.
    ·     Classical Report list sales order line details for those orders
    where the confirmed quantity is greater than the quantity PGI (post goods
    issued) after the customer requested delivery date has passed. Price list analysis report using various pricing procedures and pricing conditions.
    ·     Report for displaying the material batch information such as
    storage location, batch number, fiscal year, stock details for the given
    range of materials, plants and period information.
    ·     Purchase order Report.
    ·     Purchasing Requisition pending report.
    ·     Interactive Report for displaying Vendor Information based on the
    selection made the corresponding Vendor Bank Details is listed.
    ·     A report to get all the sales order with particular delivery.
    ·     Report to display the item purchased in a particular period of
    time, the vendor information, and credit period.
    ·     Report that lists the shipping point, loading point, transport
    partner name and the shipping date given the sales order number as user
    input.
    ·     Report for Material Requirement List for a Production Order. It
    displays the quantity of materials required to produce a material based
    on its BOM for any date duration.

    Hi Seenu,
    You said that you are able to see the screen. On that screen follow the following navigation.
    System -
    > Status
    Now you will able to see a dialogue box. In that you will find program name.
    Copy that program name and go to SE38 TCode, and paste there. Now click on display push button. Now you can see the source code.
    Regards,
    Ramesh.
    Mark all helpful answers.

  • New Front-End Editor is Dumping when I try to check an ABAP source code

    Hi Experts
    I'm trying to check the source code of any ABAP in SE38 with the new front-end editor, but I'm facing a dump, maybe there is missing a patch or something like that. if any of you have information about that I really appreciate your aswers.
    I reinstalled the SAP GUI and still have the issue.
    part of the dump is here
    Runtime Errors         MESSAGE_TYPE_X
    Date and Time          04/09/2008 15:12:51
    Short text
         The current application triggered a termination with a short dump.
    What happened?
         The current application program detected a situation which really
         should not occur. Therefore, a termination with a short dump was
         triggered on purpose by the key word MESSAGE (type X).
    Error analysis
         Short text of error message:
         Control Framework : Error processing control
         Long text of error message:
          Diagnosis
              An error occurred when the system tried to process the commands
              from the Automation Queue on the presentation server.
              There are several possible reasons for this:
              - The installation of the SAP GUI on the presentation server is
              faulty or obsolete.
              - There is an error in the application program
              - There is an error in the SAPGUI or an integrated control

    Hernan Enriquez ,
                               Hi you can try the below things :
    1) You need have the latest patch of the SAP GUI installed.
    2) If you have the above try to re-install the GUI from the scratch. It might be courrupted.
    3) If VISTA need to check the GUI compatibility.
    Thanks,
    Greetson

  • Waiting for aging report source code

    Hi,
    Please give the source code snippet for the following case.
    aging analysis program for open items:-
    payments not receivecd for 15 days,30 ,60 ,90days
    imput:
    custno range
    sales area
    days 30,60,90 selection sort by cust no,sales organization
    output :report program ALV grid format
    Many Thanks in Advance.

    Look at transaction S_ALR_87012178.
    Send the cash to Eric.
    Regards

  • W3_PUBLISH_SERVICES and dump while viewing the source code in se80

    Hi,
    external ITS6.20  on SAP R/3 4.7
    we have installed ITS and we published the templates. When we published the teampltes using the standard prgram   W3_PUBLISH_SERVICES, and around 43 of the services fail  Not sure if this is an error
    After the upgrade is finished, you must make this up, before you can use the Internet applications of the system. For a detailed procedure description see Note 399578.
    or not.
    On the other hand when i go to se 80 and try to view the source code of any ITS service lets say PZM3 in my case, the entire application goes for a dump with error
    Exception condition "INVALID PARAM VERB: TEXTSTREAM" raised.
    What happened?
    The current ABAP/4 program encountered an unexpected
    situation.
    What can you do?
    Print out the error message (using the "Print" function)
    and make a note of the actions and input that caused the
    error.
    To resolve the problem, contact your SAP system administrator.
    You can use transaction ST22 (ABAP Dump Analysis) to view and administer
    termination messages, especially those beyond their normal deletion
    date.
    Error analysis
    A RAISE statement in the program "SAPLOLEA " raised the exception
    condition "INVALID PARAM VERB: TEXTSTREAM".
    Since the exception was not intercepted by a superior program
    in the hierarchy, processing was terminated.
    Short description of exception condition:
    For detailed documentation of the exception condition, use
    Transaction SE37 (Function Library). You can take the called
    function module from the display of active calls.
    How to correct the error
    You may able to find an interim solution to the problem
    in the SAP note system. If you have access to the note system yourself,
    use the following search criteria:
    The termination occurred in the ABAP program "SAPLOLEA " in
    "AC_FLUSH_CALL_INTERNAL".
    The main program was "SAPMSEU0 ".
    The termination occurred in line 220 of the source code of the (Include)
    program "LOLEAU10 "
    of the source code of program "LOLEAU10 " (when calling the editor 2200).
    Any deas what the error could be??
    On the other hand i tried to see the Service 'System' and 'webgui' from se80 di dnot find any..
    Any ideas if we are missing in our landscape.
    Message was edited by:
            RajK
    Message was edited by:
            RajK

    Hi RajK
    > On the other hand i tried to see the Service 'System'
    > and 'webgui' from se80 di dnot find any..
    > Any ideas if we are missing in our landscape.
    The services system and webgui are shipped within the installer of ITS 6.20. So you can't find them in the database via SE80, instead only in the filesystem.
    Not your main problem, I know, but I just wanted to clarify.
    Best regards,
    Henning

  • Lost the webdynpro application source code

    Hi Experts,
    We have some webdynpro applications. Presently running in Portal server.  One of the application is giving the error. we need to fix that issue. Since we don't have any NWDI system, One of  the application source code got corrupted, Kindly let me know is there any we can retrieve the  source from the deployed application or .ear file from Portal.
    Regards
    Vijay

    Hi Guru,
    I think it is not possible to get the whole project structure.
    But you can get the java files of your local DC project by logging into your portal using the url http://host_name:5000/nwa.
    Navigate to Analysis ->Configuration ->J2EE Configuration Browser . Click on Local System Node ->apps->sap.com. Under sap.com(or the domain you have defined namespace) you can find a u2018src.zipu2019 file. In this u2018srcu2019 folder you can find the java files.
    If the error has occurred in your project while modifying particular webdynpro file, then you can get the previous version of the file(file before the error occurred) by navigating to C:\Documents\SAP\workspace\.metadata\.plugins\org.eclipse.core.resources\.history location in you local system. In history folder you can find all the versions of the webdynpro file which you were modifying till now.
    Thanks,
    Shilpa

  • Extracting operators and operands from the source code

    Hi there,
    I am looking for a way to extract operators and operands from a source code to do a complexity analysis of the code. The final outcome I am expecting is to get the number of operators and operands in the code, to perform a Halstead Complexity Analysis.
    Please let me know how this parsing can be done apart from just doing a sequential search of the content in the file.
    Any samples and references are highly appreciated.
    Thanks in advance!
    Regards,
    Aravinda777

    Common way to analyze code is to defining the things you are interested in using some approproate language and then using a parser generator (or compiler compiler = cc). I used antlr some time ago for this reason. Perhaps you want to take a look at it:
    http://www.antlr.org/

Maybe you are looking for

  • How to use Db Provider Factories with System.Data.SqlServerCe

    I'm using SQL Server Compact Edition, but in the future I would like to be able to switch to another SQL Server Edition or even a different database. To achieve this, Microsoft recommends using DB Provider Factories (see: Writing Provider Independent

  • In SAP 4.6 - Purchase order delivery address - Change

    Hi All I have created a PO and in print preview i can see the delivery address as plant address, which is also in PO item details. Now the EKPO-Address number does not have any value. Once I have changed the delivery address in item details, the deli

  • Can't click the lock to make the changes, can't install, can't uninstall

    HELP! Help! I have tried everything in the other threads and still not working. I have deleted the file from ByHost preferences folder (which just keeps returning), still can't unlock the lock on my admin account, and can't update or install any apps

  • Changing the report template

    Hi All, I have created a report using a particular template created by me. The template contains only Margin layout and font setting. Now, if i change the template can i get the report layout changed according to new template layout without disturbin

  • Safari won't start

    Not sure what's going on, i tried the suggested things of removing genieo, searchprotect,etc but none of those things were found on my computer. here's the report, can someone help me? Process:               Safari [906] Path:                  /Appli