<commit_before>package YourCompany::App::Controller::Project;

use YourCompany::Perl::UTF8;

use HTTP::Status qw( HTTP_OK HTTP_CREATED );

use parent 'YourCompany::App::Controller';

sub index( $self ) { ## no critic (Subroutines::ProhibitBuiltinHomonyms)
    return $self->render( json => {
        success => \1,
        status  => HTTP_OK,
        model   => $self->model->list(),
    } );
}

sub single( $self ) { ## no critic (Subroutines::ProhibitBuiltinHomonyms)
    my $id = ''. $self->param('id');

    return $self->render( json => {
        success => \1,
        status  => HTTP_OK,
        model   => $self->model->single($id),
    } );
}

sub create( $self ) {
    my $fields = $self->req->json;

    return $self->render( json => {
        success => \1,
        status  => HTTP_CREATED,
        model   => $self->model->create($fields),
    }, status => HTTP_CREATED );
}

sub update( $self ) {
    my $id     = ''. $self->param('id');
    my $fields = $self->req->json;

    return $self->render( json => {
        success => \1,
        status  => HTTP_OK,
        model   => $self->model->update( $id, $fields ),
    } );
}

sub delete( $self ) { ## no critic (Subroutines::ProhibitBuiltinHomonyms)
    my $id = ''. $self->param('id');

    $self->model->delete($id);

    return $self->render( json => {
        success => \1,
        status  => HTTP_OK,
    } );
}

1;
<commit_msg>Unwanted no critic here [ci skip]<commit_after>package YourCompany::App::Controller::Project;

use YourCompany::Perl::UTF8;

use HTTP::Status qw( HTTP_OK HTTP_CREATED );

use parent 'YourCompany::App::Controller';

sub index( $self ) { ## no critic (Subroutines::ProhibitBuiltinHomonyms)
    return $self->render( json => {
        success => \1,
        status  => HTTP_OK,
        model   => $self->model->list(),
    } );
}

sub single( $self ) {
    my $id = ''. $self->param('id');

    return $self->render( json => {
        success => \1,
        status  => HTTP_OK,
        model   => $self->model->single($id),
    } );
}

sub create( $self ) {
    my $fields = $self->req->json;

    return $self->render( json => {
        success => \1,
        status  => HTTP_CREATED,
        model   => $self->model->create($fields),
    }, status => HTTP_CREATED );
}

sub update( $self ) {
    my $id     = ''. $self->param('id');
    my $fields = $self->req->json;

    return $self->render( json => {
        success => \1,
        status  => HTTP_OK,
        model   => $self->model->update( $id, $fields ),
    } );
}

sub delete( $self ) { ## no critic (Subroutines::ProhibitBuiltinHomonyms)
    my $id = ''. $self->param('id');

    $self->model->delete($id);

    return $self->render( json => {
        success => \1,
        status  => HTTP_OK,
    } );
}

1;

{'fraction_non_alphanumeric': 0.1919191919191919, 'fraction_numerical': 0.005050505050505051, 'mean_word_length': 2.4576059850374063, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 87, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3093904', 'n_tokens_mistral': 953, 'n_tokens_neox': 931, 'n_words': 202}