stevebauman/maintenance

View on GitHub

Showing 68 of 213 total issues

Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

            AssetService $asset,
            MeterService $meter,
            ReadingService $meterReading,
            ConfigService $config,
            ReadingValidator $meterReadingValidator
Severity: Minor
Found in app/Http/Controllers/Asset/Meter/ReadingController.php - About 35 mins to fix

    Function closeSessions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function closeSessions()
        {
            $closed = [];
    
            foreach ($this->sessions as $session) {
    Severity: Minor
    Found in app/Models/WorkOrder.php - About 35 mins 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 showFormErrors has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    var showFormErrors = function (errors) {
        $('.status-message').remove();
        $('.errors').remove();
        $('.form-group').removeClass('has-error');
    
    
    Severity: Minor
    Found in resources/assets/js/app.js - About 35 mins 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 showFormErrors has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    var showFormErrors = function (errors) {
        $('.status-message').remove();
        $('.errors').remove();
        $('.form-group').removeClass('has-error');
    
    
    Severity: Minor
    Found in public/js/base.js - About 35 mins 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 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function handle()
        {
            // Get the requested quantity to return
            $quantity = $this->request->input('quantity');
    
    
    Severity: Minor
    Found in app/Jobs/WorkOrder/Part/Put.php - About 35 mins 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 destroy has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function destroy($api_id, $email)
        {
            $event = $this->event->findByApiId($api_id);
    
            if (count($event->attendees) > 0) {
    Severity: Minor
    Found in app/Http/Controllers/Event/AttendeeController.php - About 35 mins 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

    Avoid too many return statements within this function.
    Open

          return [ 1, "[" ];
    Severity: Major
    Found in resources/assets/js/libs/markdown.js - About 30 mins to fix

      Function getLastMovementAttribute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getLastMovementAttribute()
          {
              if ($this->movements->count() > 0) {
                  $movement = $this->movements->first();
      
      
      Severity: Minor
      Found in app/Models/InventoryStock.php - About 25 mins 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

      Severity
      Category
      Status
      Source
      Language