REBELinBLUE/deployer

View on GitHub

Showing 2,695 of 2,695 total issues

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    afterSteps.forEach((step) => {
      it(`isAfter returns true when the command is for an "After ${getStep(step)}" step`, () => {
        model.set('step', step);

        expect(model.isAfter()).to.be.true();
Severity: Major
Found in resources/assets/test/models/Command.spec.js and 3 other locations - About 2 hrs to fix
resources/assets/test/models/Command.spec.js on lines 46..52
resources/assets/test/models/Command.spec.js on lines 54..60
resources/assets/test/models/Command.spec.js on lines 62..68

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 84.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    afterSteps.forEach((step) => {
      it(`isBefore returns false when the command is for an "After ${getStep(step)}" step`, () => {
        model.set('step', step);

        expect(model.isBefore()).to.be.false();
Severity: Major
Found in resources/assets/test/models/Command.spec.js and 3 other locations - About 2 hrs to fix
resources/assets/test/models/Command.spec.js on lines 38..44
resources/assets/test/models/Command.spec.js on lines 54..60
resources/assets/test/models/Command.spec.js on lines 62..68

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 84.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    beforeSteps.forEach((step) => {
      it(`isAfter returns false when the command is for a "Before ${getStep(step)}" step`, () => {
        model.set('step', step);

        expect(model.isAfter()).to.be.false();
Severity: Major
Found in resources/assets/test/models/Command.spec.js and 3 other locations - About 2 hrs to fix
resources/assets/test/models/Command.spec.js on lines 38..44
resources/assets/test/models/Command.spec.js on lines 46..52
resources/assets/test/models/Command.spec.js on lines 54..60

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 84.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function setProjectMembers has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function setProjectMembers(array $members, Project $project)
    {
        $sync = [];

        // Attaching the members to the projects
Severity: Minor
Found in app/Repositories/EloquentProjectRepository.php - About 2 hrs to fix

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 getInstallInformation has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function getInstallInformation()
    {
        $this->header('Installation details');

        $regions = $this->getTimezoneRegions();
Severity: Major
Found in app/Console/Commands/InstallApp.php - About 2 hrs to fix

Project has 22 functions (exceeds 20 allowed). Consider refactoring.
Open

class Project extends Model implements HasPresenter
{
    use SoftDeletes, BroadcastChanges, ProjectRelations;

    const FINISHED     = 0;
Severity: Minor
Found in app/Project.php - About 2 hrs to fix

Deployment has 22 functions (exceeds 20 allowed). Consider refactoring.
Open

class Deployment extends Model implements HasPresenter, RuntimeInterface
{
    use SoftDeletes;

    const COMPLETED             = 0;
Severity: Minor
Found in app/Deployment.php - About 2 hrs to fix

File uploader.js has 260 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// TODO: Convert to ES6
let iframeCount = 0;

function Uploader(options) {
  if (!(this instanceof Uploader)) {
Severity: Minor
Found in resources/assets/src/handlers/uploader.js - About 2 hrs to fix

Function updateDeployment has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function updateDeployment(data) {
  const container = $(`#deployment_${data.model.id}`);

  if (container.length > 0) {
    const deployment = new Deployment(data.model);
Severity: Major
Found in resources/assets/src/views/Project.js - About 2 hrs to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    modelChanged() {
      const self = this;

      return (data) => {
        const model = self.collection.get(parseInt(data.model.id, 10));
Severity: Major
Found in resources/assets/src/factories/CollectionViewFactory.js and 1 other location - About 2 hrs to fix
resources/assets/src/factories/CollectionViewFactory.js on lines 54..64

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 78.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    modelTrashed() {
      const self = this;

      return (data) => {
        const model = self.collection.get(parseInt(data.model.id, 10));
Severity: Major
Found in resources/assets/src/factories/CollectionViewFactory.js and 1 other location - About 2 hrs to fix
resources/assets/src/factories/CollectionViewFactory.js on lines 42..52

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 78.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method handle has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function handle(EnvFile $writer, Requirements $requirements)
    {
        $this->line('');

        $config = base_path('.env');
Severity: Major
Found in app/Console/Commands/InstallApp.php - About 2 hrs to fix

Function save has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function save(array $input)
    {
        $path   = base_path('.env');
        $config = $this->filesystem->get($path);

Severity: Minor
Found in app/Console/Commands/Installer/EnvFile.php - About 2 hrs to fix

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 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function handle(Process $process, RefRepositoryInterface $repository)
    {
        $mirror_dir = $this->project->mirrorPath();

        $this->project->refs()->delete();
Severity: Minor
Found in app/Jobs/UpdateGitReferences.php - About 1 hr to fix

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 updateDeployment has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

function updateDeployment(data) {
  const container = $(`#deployment_${data.model.id}`);

  if (container.length > 0) {
    const deployment = new Deployment(data.model);
Severity: Minor
Found in resources/assets/src/views/Project.js - About 1 hr to fix

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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    if (this.model.isOK()) {
      css = 'success';
      icon = 'check';
      status = localize.get(`${translationKey}.ok`);
      hasRun = true;
Severity: Major
Found in resources/assets/src/views/Heartbeats.js and 1 other location - About 1 hr to fix
resources/assets/src/views/Servers.js on lines 59..68

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 72.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    } else if (this.model.isTesting()) {
      css = 'warning';
      icon = 'spinner fa-pulse';
      status = localize.get(`${translationKey}.testing`);
    } else if (this.model.isFailed()) {
Severity: Major
Found in resources/assets/src/views/Servers.js and 1 other location - About 1 hr to fix
resources/assets/src/views/Heartbeats.js on lines 24..34

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 72.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function setup has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Uploader.prototype.setup = function() {
  this.form = $(`<form method="post" enctype="multipart/form-data" target="" action="${this.settings.action}" />`);

  this.iframe = newIframe();
  this.form.attr('target', this.iframe.attr('name'));
Severity: Minor
Found in resources/assets/src/handlers/uploader.js - About 1 hr to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    protected function buildWebhookMessage($event, Channel $notification)
    {
        return (new WebhookMessage())
            ->data(array_merge(array_only(
                $this->url->attributesToArray(),
Severity: Major
Found in app/Notifications/Configurable/UrlChanged.php and 1 other location - About 1 hr to fix
app/Notifications/Configurable/HeartbeatChanged.php on lines 127..139

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 113.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    protected function buildWebhookMessage($event, Channel $notification)
    {
        return (new WebhookMessage())
            ->data(array_merge(array_only(
                $this->heartbeat->attributesToArray(),
Severity: Major
Found in app/Notifications/Configurable/HeartbeatChanged.php and 1 other location - About 1 hr to fix
app/Notifications/Configurable/UrlChanged.php on lines 125..137

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 113.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language