Showing 76 of 2,695 total issues
Function handle
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function handle(Dispatcher $dispatcher, Requirements $requirements, EnvFile $writer)
{
$this->line('');
if (!$this->checkCanInstall() || !$requirements->check($this)) {
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function handle
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function handle($request, Closure $next, $guard = null)
{
$authenticated_user = $this->auth->guard($guard)->user();
$has_valid_token = false;
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method handle
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(Dispatcher $dispatcher, Validation $validation)
{
$arguments = [
'name' => $this->argument('name'),
'email' => $this->argument('email'),
- Create a ticketCreate a ticket
Method handle
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(Process $process, Filesystem $filesystem, LogFormatter $formatter)
{
$this->server->status = Server::TESTING;
$this->server->connect_log = null;
$this->server->save();
- Create a ticketCreate a ticket
Function viewData
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
viewData() {
const data = this.model.toJSON();
let css = 'info';
let icon = 'clock-o';
- Create a ticketCreate a ticket
Method handle
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle()
{
$tmp_dir = storage_path('app/tmp');
// Clear out old SSH key files and archives
- Create a ticketCreate a ticket
Method buildSlackMessage
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function buildSlackMessage($translation, Channel $notification)
{
$message = $this->translator->trans($translation);
$fields = [
- Create a ticketCreate a ticket
Function Uploader
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Uploader(options) {
if (!(this instanceof Uploader)) {
return new Uploader(options);
}
- Create a ticketCreate a ticket
Method fail
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function fail(Exception $error)
{
$this->deployment->project->status = Project::FAILED;
$this->deployment->status = Deployment::FAILED;
- Create a ticketCreate a ticket
Function viewData
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
viewData() {
const data = this.model.toJSON();
let css = 'primary';
let icon = 'question';
- Create a ticketCreate a ticket
Method listing
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function listing($target_id, $action)
{
$types = [
'clone' => Command::DO_CLONE,
'install' => Command::DO_INSTALL,
- Create a ticketCreate a ticket
Function showLogDialog
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showLogDialog(event) {
const button = $(event.relatedTarget);
const dialog = $(event.target);
const logId = button.attr('id').replace('log_', '');
- Create a ticketCreate a ticket
Method handle
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(Process $process, Parser $parser, Filesystem $filesystem)
{
$private_key = $filesystem->tempnam(storage_path('app/tmp/'), 'key');
$filesystem->put($private_key, $this->project->private_key);
$filesystem->chmod($private_key, 0600);
- Create a ticketCreate a ticket
Method update
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function update()
{
$prev = base_path('.env.prev');
$current = base_path('.env');
$dist = base_path('.env.dist');
- Create a ticketCreate a ticket
Method handle
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(Filesystem $filesystem)
{
$this->filesystem = $filesystem;
$this->waitIfMirroring();
- Create a ticketCreate a ticket
Method runDeploymentStepOnServer
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function runDeploymentStepOnServer(ServerLog $log)
{
$process = $this->builder->buildScript($log->server);
if (!empty($process)) {
- Create a ticketCreate a ticket
Method buildSlackMessage
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function buildSlackMessage($translation, Channel $notification)
{
$message = $this->translator->trans($translation, ['job' => $this->heartbeat->name]);
$url = route('projects', ['id' => $this->heartbeat->project_id]);
- Create a ticketCreate a ticket
Method verifyDatabaseDetails
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function verifyDatabaseDetails(array $database)
{
if ($database['connection'] === 'sqlite') {
return $this->filesystem->touch(database_path('database.sqlite'));
}
- Create a ticketCreate a ticket
Function viewData
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
viewData() {
const data = this.model.toJSON();
let css = 'primary';
let icon = 'question';
- Create a ticketCreate a ticket
Function getBranchUrlAttribute
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getBranchUrlAttribute($alternative = null)
{
$info = $this->accessDetails();
if (isset($info['domain']) && isset($info['reference'])) {
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"