partkeepr/PartKeepr

View on GitHub

Showing 481 of 922 total issues

Function handler has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

                        handler: function (grid, rowIndex, colIndex, item, e, record)

    Function renderer has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        renderer: function (val, q, rec)
        {
            var part = rec.getPart();
            var total = 0;
            var partUnit = "";

    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 deeply nested control flow statements.
    Open

                            if (data[roleName][i].isEntity) {
                                idProperty = data[roleName][i].idProperty;
                                delete data[roleName][i].data[idProperty];
                            }
    Severity: Major
    Found in src/PartKeepr/FrontendBundle/Resources/public/js/Data/HydraModel.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              switch (strtolower($node->args[1]->value->name->parts[0])) {
                                  case 'true':
                                      $value = true;
                                      break;
                                  case 'false':
      Severity: Major
      Found in src/PartKeepr/SetupBundle/Visitor/ConfigVisitor.php - About 45 mins to fix

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

                ClassMetadata $classMetadata,
                $baseEntity,
                ReflectionService $reflectionService,
                EntityManager $em,
                AdvancedSearchFilter $advancedSearchFilter,
        Severity: Minor
        Found in src/PartKeepr/ImportBundle/Configuration/BaseConfiguration.php - About 45 mins to fix

          Function extractConfiguration has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public function extractConfiguration($filterData, $sorterData)
              {
                  $filters = [];
          
                  if (is_array($filterData)) {
          Severity: Minor
          Found in src/PartKeepr/DoctrineReflectionBundle/Filter/AdvancedSearchFilter.php - About 45 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 deeply nested control flow statements.
          Open

                                  if (associated === undefined) {
                                      options.associated = deep;
                                      clear = true;
                                  } else {
                                      if (!deep) {
          Severity: Major
          Found in src/PartKeepr/FrontendBundle/Resources/public/js/Data/HydraModel.js - About 45 mins to fix

            Function getSystemPreference has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                getSystemPreference: function (key, defaultValue)
                {
                    if (this.systemPreferenceStore === undefined) {
                        return defaultValue;
                    }

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

                onSuccess: function (response) {
                    try {
                        var responseObj = Ext.decode(response.responseText);
                    } catch (e) {
                        var responseObj = {};
            Severity: Minor
            Found in web/setup/js/SetupTests/WebserverLogTest.js - About 45 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

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

                    ManagerRegistry $managerRegistry,
                    IriConverterInterface $iriConverter,
                    PropertyAccessorInterface $propertyAccessor,
                    RequestStack $requestStack,
                    FilterService $filterService,
            Severity: Minor
            Found in src/PartKeepr/DoctrineReflectionBundle/Filter/AdvancedSearchFilter.php - About 45 mins to fix

              Function switchView has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  switchView: function (index)
                  {
                      var nextBtn = this.down('#nextBtn'),
                          previousButton = this.down('#previousButton'),
                          childViewCount = this.cardContainer.items.getCount();
              Severity: Minor
              Found in web/setup/js/wizard/BreadCrumbWizard.js - About 45 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 getExpressionForFilter has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getExpressionForFilter(Filter $filter, $alias, $paramName)
                  {
                      switch (strtolower($filter->getOperator())) {
                          case Filter::OPERATOR_EQUALS:
                              return $this->em->getExpressionBuilder()->eq($alias, $paramName);
              Severity: Minor
              Found in src/PartKeepr/DoctrineReflectionBundle/Services/FilterService.php - About 45 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 parseConfiguration has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function parseConfiguration($configuration)
                  {
                      if (!property_exists($configuration, "fieldConfiguration")) {
                          return false;
              
              
              Severity: Minor
              Found in src/PartKeepr/ImportBundle/Configuration/FieldConfiguration.php - About 45 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

              Method parsebox has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                      def parsebox(list, n)
                        assert_type n, :Number
                        if !n.int?
                          raise ArgumentError.new("List index #{n} must be an integer")
                        elsif n.to_i < 1
              Severity: Minor
              Found in theme/themes/lib/utils.rb - About 45 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 onKernelView has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function onKernelView(GetResponseForControllerResultEvent $event)
                  {
                      $controllerResult = $event->getControllerResult();
              
                      if ($controllerResult instanceof Response) {

              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

              Consider simplifying this complex logical expression.
              Open

                          if (load || store.isLoading()) {
                              store.on('load', function (store, records, success, operation) {
                                  args = [store, operation];
                                  scope = scope || options.scope || inverseRecord;
              
              

                Function treeMaker has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    treeMaker: function (node, model, prefix, callback, originalVisitedModels)

                  Function _onItemKeyPress has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      _onItemKeyPress: function (view, record, item, index, e) {

                    Function columnRenderer has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        columnRenderer: function (value, metadata, record, rowIndex, colIndex)

                      Function getAssociatedStore has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          getAssociatedStore: function (inverseRecord, options, scope, records, isComplete) {
                        Severity
                        Category
                        Status
                        Source
                        Language