cattr-app/server-application

View on GitHub

Showing 177 of 177 total issues

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

        {
            key: 'type',
            label: 'field.type',
            placeholder: 'field.types.any',
            saveToQuery: true,
Severity: Major
Found in resources/frontend/core/modules/Users/sections/users.js and 1 other location - About 2 hrs to fix
resources/frontend/core/modules/Users/sections/users.js on lines 330..352

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 75.

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

        {
            key: 'active',
            label: 'field.statuses',
            placeholder: 'users.statuses.any',
            saveToQuery: true,
Severity: Major
Found in resources/frontend/core/modules/Users/sections/users.js and 1 other location - About 2 hrs to fix
resources/frontend/core/modules/Users/sections/users.js on lines 380..402

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 75.

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

            render: (h, props) => {
                return h(VueEditor, {
                    props: {
                        useMarkdownShortcuts: true,
                        editorToolbar: [
Severity: Minor
Found in resources/frontend/core/modules/Tasks/module.init.js - About 1 hr to fix

    Method up has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function up()
        {
            $user_role_id = 2;
            $manager_role_id = 5;
            $blocked_role_id = 255;
    Severity: Minor
    Found in database/migrations/2018_09_27_100017_update_rules.php - About 1 hr to fix

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

      <?php
      
      use Illuminate\Database\Migrations\Migration;
      use Illuminate\Database\Schema\Blueprint;
      use Illuminate\Support\Facades\Schema;
      database/migrations/2018_05_16_160406_add_user_id_to_time_interval.php on lines 1..35

      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 119.

      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

      <?php
      
      use Illuminate\Support\Facades\Schema;
      use Illuminate\Database\Schema\Blueprint;
      use Illuminate\Database\Migrations\Migration;
      database/migrations/2020_12_25_064540_add_default_priority_to_projects.php on lines 1..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 119.

      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 3 locations. Consider refactoring.
      Open

      export function init(context, router) {
          context.addCompanySection(require('./sections/statuses').default(context, router));
      
          context.addLocalizationData({
              en: require('./locales/en'),
      Severity: Major
      Found in resources/frontend/core/modules/Statuses/module.init.js and 2 other locations - About 1 hr to fix
      resources/frontend/core/modules/Invitations/module.init.js on lines 7..16
      resources/frontend/core/modules/Priorities/module.init.js on lines 7..16

      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 70.

      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 3 locations. Consider refactoring.
      Open

      export function init(context, router) {
          context.addCompanySection(require('./sections/invitations').default(context, router));
      
          context.addLocalizationData({
              en: require('./locales/en'),
      Severity: Major
      Found in resources/frontend/core/modules/Invitations/module.init.js and 2 other locations - About 1 hr to fix
      resources/frontend/core/modules/Priorities/module.init.js on lines 7..16
      resources/frontend/core/modules/Statuses/module.init.js on lines 7..16

      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 70.

      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 3 locations. Consider refactoring.
      Open

      export function init(context, router) {
          context.addCompanySection(require('./sections/priorities').default(context, router));
      
          context.addLocalizationData({
              en: require('./locales/en'),
      Severity: Major
      Found in resources/frontend/core/modules/Priorities/module.init.js and 2 other locations - About 1 hr to fix
      resources/frontend/core/modules/Invitations/module.init.js on lines 7..16
      resources/frontend/core/modules/Statuses/module.init.js on lines 7..16

      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 70.

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

      export function fieldsToFillProvider() {
          return [
              {
                  key: 'id',
                  displayable: () => false,
      Severity: Minor
      Found in resources/frontend/core/modules/Users/sections/users.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

                  this.navEntriesMenuDropdown.push(
                      new NavbarEntry({
                          label: a.label,
                          to: a.to,
                          displayCondition: Object.prototype.hasOwnProperty.call(a, 'displayCondition')
      Severity: Major
      Found in resources/frontend/core/arch/module.js and 1 other location - About 1 hr to fix
      resources/frontend/core/arch/module.js on lines 128..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 69.

      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

                  moduleInitQueue.push({
                      module: md,
                      order: Object.prototype.hasOwnProperty.call(moduleInitData, 'loadOrder')
                          ? moduleInitData.loadOrder
                          : 999,
      Severity: Major
      Found in resources/frontend/core/moduleLoader.js and 1 other location - About 1 hr to fix
      resources/frontend/core/moduleLoader.js on lines 136..143

      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 69.

      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

              moduleInitQueue.push({
                  module: md,
                  order: Object.prototype.hasOwnProperty.call(moduleInitData, 'loadOrder') ? moduleInitData.loadOrder : 999,
                  moduleInitData,
                  fullModuleName,
      Severity: Major
      Found in resources/frontend/core/moduleLoader.js and 1 other location - About 1 hr to fix
      resources/frontend/core/moduleLoader.js on lines 68..77

      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 69.

      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

                  this.navEntriesDropdown[p.section].push(
                      new NavbarEntry({
                          label: p.label,
                          to: p.to,
                          displayCondition: Object.prototype.hasOwnProperty.call(p, 'displayCondition')
      Severity: Major
      Found in resources/frontend/core/arch/module.js and 1 other location - About 1 hr to fix
      resources/frontend/core/arch/module.js on lines 146..155

      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 69.

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

          public function edit(EditTaskRequest $request): JsonResponse
          {
              Filter::listen(
                  Filter::getRequestFilterName(),
                  static function (array $requestData) {
      Severity: Minor
      Found in app/Http/Controllers/Api/TaskController.php - About 1 hr to fix

        Function timePerProject has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            timePerProject: (state, getters) => {
                return Object.keys(getters.intervals).reduce((result, userID) => {
                    const userEvents = getters.intervals[userID];
                    if (!userEvents) {
                        return result;
        Severity: Minor
        Found in resources/frontend/core/modules/Dashboard/storeModule.js - About 1 hr to fix

          Function render has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      render: (h, props) => {
                          const data = [];
                          Object.keys(props.currentValue).forEach(k => {
                              props.currentValue[k].time = formatDurationString(+props.currentValue[k].duration);
                              data.push(props.currentValue[k]);
          Severity: Minor
          Found in resources/frontend/core/modules/Tasks/module.init.js - About 1 hr to fix

            Method up has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function up()
                {
                    DB::unprepared('
                        CREATE OR REPLACE VIEW `project_report` AS
                        SELECT
            Severity: Minor
            Found in database/migrations/2019_09_24_054346_fix_project_report_view.php - About 1 hr to fix

              Method up has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function up()
                  {
                      DB::unprepared('
                          CREATE OR REPLACE VIEW `project_report` AS
                          SELECT
              Severity: Minor
              Found in database/migrations/2019_12_20_073840_fix_project_report.php - About 1 hr to fix

                Function handle has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function handle(): int
                    {
                        if ($this->option('email')) {
                            $email = $this->option('email');
                
                
                Severity: Minor
                Found in app/Console/Commands/MakeAdmin.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

                Severity
                Category
                Status
                Source
                Language