Giter Club home page Giter Club logo

glitch's People

Contributors

ashrick12 avatar jff avatar joaotgoncalves avatar miguelchenriques avatar nfsaavedra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

glitch's Issues

Multifaceted abstraction smell (Sharma et al. 2016)

This smell can be detected in two different ways for Puppet:

  1. More than one resource is defined in the declaration of a file, service or package. We are not currently able to support this because of #7.
  2. Calculation of the LCOM. LCOM is related to the intersection of parameters between components. We should be able to support this easily if we implement #6.

Improve print representation of hierarchical attributes

The print should be recursive and follow the same patterns as the other components, otherwise it becomes hard to understand what is going on.

Instead of this:

roles[0]->None attributes: [name:'Install dependencies']

We want something like this:

roles[0]->None:
  attributes:
    name->Install dependencies

support node management

Describe the solution you'd like
It would be interesting to have support in the intermediate representation for the management of nodes, i.e., for instance the inventory in Ansible and the node construct in Puppet.

change attributes of UnitBlock to be more object-oriented

Describe the solution you'd like
Right now, the UnitBlock has an attribute for each type of element. However, this does not scale well, does not adhere to good practices of object-oriented programming and it is not intuitive when generic statements are in the mix. For instance, let's imagine a conditional statement has a atomic unit in its blocks. Should the atomic unit also be added to the atomic_units attribute? It doesn't make sense.

Describe alternatives you've considered
The UnitBlock should have a single attribute for statements.

add black to CI

Describe the solution you'd like
It would be nice to have black in the CI. This would enforce the usage of black.

MD5 triggers weak crypt smell on checksums

Currently doing checksums with md5 will trigger weak crypt smell, eg:

# Docker
RUN md5sum foo.sh

In this case md5sum is being used to verify the integrity of the file and it will trigger the weak crypt smell. md5sum and other checksums commands (shasum, sha1sum, etc..) should be whitelisted.

have an automated test for the oracles

Describe the solution you'd like
It would be nice to have an automated test that checks if the number of true/false positives and true/false negatives remains the same for the oracle datasets used in GLITCH's studies.

Long statement detected on 140 characters

Describe the bug
Long statement is being detected when we have 140 characters + '\n'.

To Reproduce
Run GLITCH on script with a line with 140 characters + '\n'.

Expected behavior
It shouldn't detect the smell

refactor Ansible parser to use the ansible package

Is your feature request related to a problem? Please describe.
Currently GLITCH does not support attributes defined as in the example below (aka Ansible-specific syntax):

- name: Create web root
  file: path="{{ www_root }}"
        owner="{{ web_user }}"
        group="{{ web_group }}"
        mode=0755
        state=directory
  with_dict: sites

This is mentioned in the work by Opdebeeck et al. (2023).

Describe the solution you'd like
We shoud use the ansible-core package instead of the yaml package..

simplify CLI options

Describe the solution you'd like
Right now some CLI options are not very clear. For instance, the --includeall and --dataset are not very clear and should be replaced with simpler options or even removed. The --linterand --csv option could also be replaced with a format option.

Evaluation status

Puppet

  • Collect dataset (Rahman)
  • Compute and validate dataset statistics
  • Collect Oracle (Our own)
  • Compute and validate oracle statistics
  • Run SLIC: collect results and execution time
    • Oracle
    • Compute precision and accuracy
    • Rahman's dataset (7 smells) ๐ŸŽฏ
  • Run GLITCH: collect results and execution time
    • Oracle
    • Compute precision and accuracy
    • Rahman's dataset (7 smells) ๐ŸŽฏ
    • Rahman's dataset (all of GLITCH's supported smells) ๐ŸŽฏ

Ansible

  • Collect dataset (our own, following same criteria as Rahman and Rahman Openstack Dataset)
  • Compute and validate dataset statistics
  • Collect Oracle (Rahman)
  • Compute and validate oracle statistics
  • Review Oracle and add code line to each smell
  • Run SLAC: collect results and execution time
    • Oracle ๐ŸŽฏ
    • Compute precision and accuracy ๐ŸŽฏ
    • Rahman's dataset (8 smells)
  • Run GLITCH: collect results and execution time
    • Oracle ๐ŸŽฏ
    • Compute precision and accuracy ๐ŸŽฏ
    • Rahman's dataset (8 smells)
    • Rahman's dataset (all of GLITCH's supported smells)

Chef

  • Collect dataset (our own, following same criteria as Rahman)
  • Compute dataset statistics
  • Collect Oracle (Our own)
  • Compute and validate oracle statistics
  • Run SLAC: collect results and execution time
    • Oracle
    • Compute precision and accuracy
    • Run on dataset (9 smells) ๐ŸŽฏ
  • Run GLITCH: collect results and execution time
    • Oracle
    • Compute precision and accuracy
    • Run on dataset (9 smells) ๐ŸŽฏ
    • Run on dataset (all of GLITCH's supported smells; same as above?) ๐ŸŽฏ

Ansible script type

It would be interesting if there was a better way to define the type of an Ansible script (vars, tasks or script)

Add versions to requirements.txt

          This is fine, but it might be a good idea to include versions (perhaps the best is to create a separate issue for that). Otherwise, we might have issues in a near future related to incompatible versions.

Originally posted by @jff in #19 (comment)

missing integrity check on values with spaces

Describe the bug
The regex for the missing integrity check isn't triggered on values as such:
https://storage.googleapis.com/cri-containerd-release/cri-containerd-{{ containerd_version }}.linux-amd64.tar.gz
This happens because of the space before and after the variable.

To Reproduce
Run GLITCH on this script:
https://github.com/starlingx/ansible-playbooks/blob/7983841637966089106bb80f28d7b701ec6b6323/playbookconfig/src/playbooks/roles/provision-edgeworker/prepare-edgeworker/kubernetes/tasks/install-ubuntu-packages.yml#L31

Expected behavior
Detecting a Missing integrity check smell.

Parse values in the intermediate representation

We should parse the values in the intermediate representation allowing to differ, for instance, types (booleans, strings, numbers...) and expressions (ands, ors ...). This parsing would allow to define other type of smells in a more accurate way. For instance, imagine the smell "Hard-coded secret". We have something like: $test | "hello". Although a variable is present, there is still a chance that the secret is hard-coded.

condition statement and conditions should have different representations

Is your feature request related to a problem? Please describe.
Right now the condition statement and its conditions are represented with the same construct ConditionStatement. However, this doesn't allow the distinction between them and sometimes the conditions are used as being the condition statement itself.
For instance:

$php_prefix = $::osfamily ? {
    'debian' => 'php5-',
    'redhat' => 'php-',
}

Only has a ConditionStatement for the first condition and one for the second condition, but it doesn't have a construct for the actual switch statement.

Describe the solution you'd like
We should create a new construct either for the conditions or the switch/if statements.

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.