Gen EDGE

 View Only
  • 1.  # Of Generation Code lines

    Posted Nov 07, 2018 01:53 AM

    Hi All;

     

    Is it simply way to  get  number of generation Code lines  per model  (Java & .Net & Cobol ) ?



  • 2.  Re:  # Of Generation Code lines

    Broadcom Employee
    Posted Nov 07, 2018 07:12 PM

    HI Tarek,

    I don't think it is possible to get that information from the model because the number of generated code lines per action block etc is always larger than the number of statements coded and the difference is variable.

    So only a line count on the actual generated code files will be able to give you that.

    Perhaps another user has come across this before and can suggest a different approach. Also tagging DariusPanahy 

     

    Thanks

     

    Lynn



  • 3.  Re:  # Of Generation Code lines

    Posted Nov 07, 2018 08:43 PM

    Lynn's correct in that there's not a nice predictable number based off the statement count, as it depends on a multitude of things.

    If you have all the generated code on a Windows box, it's reasonably straightforward with a PowerShell script and run it within the source colder.

    $table = @{}
    $total = 0
    dir .\* -include ('*.c', '*.sqc') | foreach {
         $f = $_.Name
        $c = (Get-Content $f | Measure-Object -Line).Lines
        $table.Add( $f, $c )
        $total += $c
    }
    $table | Format-Table
    "Total of $total lines across the files"


  • 4.  Re:  # Of Generation Code lines

    Posted Nov 08, 2018 03:48 AM

    Tarek,

     

    If you want to assess the size of objects, in VerifIEr we have a check that reports the total number of action diagram statements per action diagram and a separate check that computes a complexity count so that you can more readily assess which are the more complex action diagrams. These are mainly used to report on action diagrams that have excessive complexity and therefore are candidates for simplification or at least extended testing.

     

    Our code coverage tool pathvIEw also calculates a cyclomatic complexity count which can be used to assess complexity of the logic from the point of view of testing. More information here:  Cyclomatic Complexity and CA Gen.

     

    However if you just want the grand total of source code lines then scanning the source code folders is probably the easiest approach. It all depends what you are trying to achieve.

     

    Regards,

     

    Darius



  • 5.  Re:  # Of Generation Code lines

    Posted Dec 17, 2018 04:42 AM

    Hi All ;

    i use this  tool  and  i get what I'm looking for

     

    http://www.locmetrics.com/

     

    LocMetrics counts total lines of code (LOC), blank lines of code (BLOC), comment lines of code (CLOC), lines with both code and comments (C&SLOC), logical source lines of code (SLOC-L), McCabe VG complexity (MVG), and number of comment words (CWORDS). Physical executable source lines of code (SLOC-P) is calculated as the total lines of source code minus blank lines and comment lines. Counts are calculated on a per file basis and accumulated for the entire project. LocMetrics also generates a comment word histogram.

     

    LocMetrics Pie Chart

     

    LocMetrics User Interface