Giter VIP home page Giter VIP logo

Comments (3)

mgalloy avatar mgalloy commented on July 24, 2024

r617 adds basic cyclomatic complexity calculations. There are user-defined limits with the COMPLEXITY_CUTOFFS keyword. The complexity computation should be further refined because currently it will parse comments and string literals while also not counting CASE and SWITCH statements correctly.

from idldoc.

mgalloy avatar mgalloy commented on July 24, 2024

There is a better IDL code parser now in the complexity calculation and modified cyclometric complexity is now computed as well. But to get the complexity right, a full IDL parser (or more heuristics) is needed because the : indicating a case in a SWITCH or CASE statement is also used in the ternary operator, a label, and array indexing.

from idldoc.

mgalloy avatar mgalloy commented on July 24, 2024

8e0dd39 adds bracket level as a heuristic to determine what type of : is used. Problems with this approach:

  1. misses ternary operators inside parentheses or square brackets
  2. counts labels, but this might be a good idea to count towards complexity since a label is generally used with GOTO or ON_IOERROR as a target to jump to

This is not perfect, but I think that a full IDL parser would not be worth it.

from idldoc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.