Giter VIP home page Giter VIP logo

code-insight's People

Contributors

aik099 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

code-insight's Issues

Allow BC break detection between main project db and the fork

Right now bc command accepts these arguments/options:

  • source path (required)
  • source fork (default: empty)
  • target path (default: current project)
  • target fork (default: empty)

Such defaults work perfectly, when a need arises to compare 2 working copies, but doesn't work, when a need arises to compare project with it's own version in past.

Proposing to:

  1. make either source path or source fork required
  2. when source path is missing, but source fork is specified, then use target path as source path

Add "deprecations" command

The command will show deprecated code elements (properties, classes, methods) introduced in new version in comparison to old version.

Allow ignoring specific BC breaks for "bc" command

The bc command only reports technical (by definition) BC breaks, which in some cases:

  • can be a false positive (e.g. parameter of method renamed for clarity)
  • can be intended change (e.g. scope reduced)

Once #11 is implemented the BC break definition can be exported as JSON. This in turn can be used to define bc break ignore rules via bc_ignore setting in .code-inside.json file.

This way all handled BC breaks can be marked in there and no longer be reported on next run.

An optional reference parameter can be defined with each ignore telling why this was ignored in first place.

Add "cs" command

For single-class analysis the PHP_CodeSniffer is the best tool to use. However it can't do cross-class analysis.

Things to check:

  1. no E_STRICT violations (ensure, that sub-class method signature is substr of all parent classes method signature)

Change in protected members of final class should be ignored

When class was final and stayed final then it's protected members (e.g. properties or methods) should be considered as private in terms of BC checks, e.g.:

  • ignore scope reduction (from protected to private)
  • ignore signature change of protected methods

Moving property/method from/to static should be a bc break

When property/method becomes static or looses static status it should trigger BC break because:

  1. accessing non-static property/method in a static way would trigger a notice
  2. accessing static property/method in a non-static way is just bad practice

Add "--format" option to "bc" command

Right now the bc command always prints human readable report. Proposing to:

  1. during bc break collection store them in some kind of data structure instead of printing back to user
  2. via --format option allow exporting bc breaks as: text, html, json

In-Portal class BC checker false positive for tag detection

The tag in In-Portal is considered any method, that:

  • is located within *TagProcessor class
  • name starts with uppercase letter
  • has single parameter named $params

Turns out that method name isn't checked and prepareTagParams($params) also is detected as tag.

Allow commit-based version comparison (bc, cs command)

Currently to run cross-version commands the 2 working copies needs to exist in parallel and each have:

  • code-inside.sqlite database
  • .code-inside.json config file

This becomes a problem when there is only 1 working copy and comparison needs to be made between 2 commits (e.g. current and previous) in it. In that case the .code-inside.json file is committed, but code-inside.sqlite file isn't.

Implementation ideas:

  • store code-inside.sqlite not next to .code-inside.json file in the project folder, but inside ~/.code-insight/xxx folder where xxx is absolute path to folder containing .code-inside.json file
  • add --fork name option to sync command, that will instruct all changes to be made on db copy under given name
  • allow for bc and cs commands to have source-path and target-path paths to allow forks, when new --source-fork and --target-fork options are specified

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.