honeybee/trellis

View on GitHub

Showing 177 of 223 total issues

Method getUsedEmbedDefinitions has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getUsedEmbedDefinitions(EntityTypeDefinition $type_definition)
    {
        $embed_types_definitions_list = new EntityTypeDefinitionList();
        $embed_type_attributes = $type_definition->getAttributes()->filterByType('embedded-entity-list');

Severity: Minor
Found in src/CodeGen/Schema/EntityTypeSchema.php - About 1 hr to fix

    Method execute has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function execute($value, EntityInterface $entity = null)
        {
            $null_value = $this->getOption(AttributeInterface::OPTION_NULL_VALUE, null);
            if ($value === $null_value || $value === '') {
                // accept NULL or empty string as valid NULL value when NULL value is NULL :D
    Severity: Minor
    Found in src/Runtime/Attribute/GeoPoint/GeoPointRule.php - About 1 hr to fix

      Method execute has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function execute($value, EntityInterface $entity = null)
          {
              if (is_null($value)) {
                  $value = '';
              }
      Severity: Minor
      Found in src/Runtime/Validator/Rule/Type/ScalarRule.php - About 1 hr to fix

        Method castArray has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function castArray($array)
            {
                $value_type = $this->getOption(self::OPTION_VALUE_TYPE, self::VALUE_TYPE_SCALAR);
        
                $casted = [];
        Severity: Minor
        Found in src/Runtime/Validator/Rule/Type/KeyValueListRule.php - About 1 hr to fix

          Method parseOffsetExpression has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected static function parseOffsetExpression($offset_expression)
              {
                  $compare_attribute = null;
                  $compare_value = null;
          
          
          Severity: Minor
          Found in src/Runtime/Attribute/AttributeValuePath.php - About 1 hr to fix

            Method execute has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function execute($value, EntityInterface $entity = null)
                {
                    if (!is_string($value)) {
                        $this->throwError('non_string_value', [], IncidentInterface::CRITICAL);
                        return false;
            Severity: Minor
            Found in src/Runtime/Validator/Rule/Type/ChoiceRule.php - About 1 hr to fix

              Function execute has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function execute($value, EntityInterface $entity = null)
                  {
                      try {
                          if (is_array($value)) {
                              if (!empty($value) && !$this->isAssoc($value)) {
              Severity: Minor
              Found in src/Runtime/Attribute/Asset/AssetRule.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 execute has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function execute($value, EntityInterface $entity = null)
                  {
                      try {
                          if (is_array($value)) {
                              if (!empty($value) && !$this->isAssoc($value)) {
              Severity: Minor
              Found in src/Runtime/Attribute/Image/ImageRule.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

              Method getConfusableChecker has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function getConfusableChecker()
                  {
                      $spoofchecker = new Spoofchecker();
              
                      // Allowing only certain locales enables rejection of e.g. korean script when a text should be en_US only
              Severity: Minor
              Found in src/Runtime/Validator/Rule/Type/SpoofcheckerRule.php - About 1 hr to fix

                Method getUrlFromArray has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function getUrlFromArray(array $url_parts)
                    {
                        // generate the resulting URL
                        $url = $url_parts['scheme'] . $this->getOption(self::OPTION_SCHEME_SEPARATOR, '://');
                
                
                Severity: Minor
                Found in src/Runtime/Validator/Rule/Type/UrlRule.php - About 1 hr to fix

                  Method getAttributeByPath has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function getAttributeByPath(EntityTypeInterface $type, $attribute_path)
                      {
                          $path_parts = explode(self::PATH_DELIMITER, $attribute_path);
                  
                          if ($path_parts % 2 === 0) {
                  Severity: Minor
                  Found in src/Runtime/Attribute/AttributePath.php - About 1 hr to fix

                    Method getSuspiciousChecker has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function getSuspiciousChecker()
                        {
                            $spoofchecker = new Spoofchecker();
                    
                            // Allowing only certain locales enables rejection of e.g. korean script when a text should be en_US only
                    Severity: Minor
                    Found in src/Runtime/Validator/Rule/Type/SpoofcheckerRule.php - About 1 hr to fix

                      Method getValidator has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function getValidator()
                          {
                              if (!$this->validator) {
                                  $default_validator_class = Validator::CLASS;
                                  $validator_implementor = $this->getOption(self::OPTION_VALIDATOR, $default_validator_class);
                      Severity: Minor
                      Found in src/Runtime/Attribute/Attribute.php - About 1 hr to fix

                        Method getMetadataOptions has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function getMetadataOptions()
                            {
                                $options = $this->getOptions();
                        
                                $value_type = self::METADATA_VALUE_TYPE_SCALAR;
                        Severity: Minor
                        Found in src/Runtime/Attribute/Asset/AssetRule.php - About 1 hr to fix

                          Method createEntityList has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function createEntityList(array $entities_data)
                              {
                                  $type_map = [];
                                  foreach ($this->getOption(self::OPTION_REFERENCE_MODULES, []) as $type) {
                                      $type_map[$type->getEntityType()] = $type;
                          Severity: Minor
                          Found in src/Runtime/Validator/Rule/Type/ReferenceRule.php - About 1 hr to fix

                            Method getMetadataOptions has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                protected function getMetadataOptions()
                                {
                                    $options = $this->getOptions();
                            
                                    $value_type = self::METADATA_VALUE_TYPE_SCALAR;
                            Severity: Minor
                            Found in src/Runtime/Attribute/Image/ImageRule.php - About 1 hr to fix

                              Function execute has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  protected function execute($value, EntityInterface $entity = null)
                                  {
                                      try {
                                          if (is_array($value)) {
                                              if (!empty($value) && !$this->isAssoc($value)) {
                              Severity: Minor
                              Found in src/Runtime/Attribute/HtmlLink/HtmlLinkRule.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 valueEquals has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  protected function valueEquals($other_value)
                                  {
                                      if (!is_array($other_value)) {
                                          return false;
                                      }
                              Severity: Minor
                              Found in src/Runtime/Attribute/ImageList/ImageListValueHolder.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 valueEquals has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  protected function valueEquals($other_value)
                                  {
                                      if (!is_array($other_value)) {
                                          return false;
                                      }
                              Severity: Minor
                              Found in src/Runtime/Attribute/HtmlLinkList/HtmlLinkListValueHolder.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 createEntityList has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  protected function createEntityList(array $entities_data)
                                  {
                                      $type_map = [];
                                      foreach ($this->getOption(self::OPTION_REFERENCE_MODULES, []) as $type) {
                                          $type_map[$type->getEntityType()] = $type;
                              Severity: Minor
                              Found in src/Runtime/Validator/Rule/Type/ReferenceRule.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