honeybee/trellis

View on GitHub

Showing 177 of 223 total issues

Method execute has 44 lines of code (exceeds 25 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

    Method createComplexValue has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function createComplexValue(AttributeInterface $attribute, array $options = array())
        {
            $values = array();
            $value_holder = $attribute->createValueHolder();
            $value_type = $value_holder->getValueType();
    Severity: Minor
    Found in src/Sham/DataGenerator.php - About 1 hr to fix

      Function getMetadataOptions has a Cognitive Complexity of 14 (exceeds 5 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

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

          protected function execute($values, EntityInterface $entity = null)
          {
              if (!is_array($values)) {
                  $this->throwError('non_array_value', [], IncidentInterface::CRITICAL);
                  return false;
      Severity: Minor
      Found in src/Runtime/Attribute/TextList/TextListRule.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 getMetadataOptions has a Cognitive Complexity of 14 (exceeds 5 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

      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 execute has 42 lines of code (exceeds 25 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

        Function getUrlFromArray has a Cognitive Complexity of 13 (exceeds 5 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

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

            public function __construct(array $data)
            {
                // check for mandatory property values
                foreach ($this->getMandatoryPropertyNames() as $name) {
                    if (!array_key_exists($name, $data)) {
        Severity: Minor
        Found in src/Runtime/Attribute/GeoPoint/GeoPoint.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 getAttributeValueByPath has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function getAttributeValueByPath(EntityInterface $entity, $value_path)
            {
                if (!mb_strpos($value_path, self::PATH_DELIMITER)) {
                    return $entity->getValue($value_path);
                }
        Severity: Minor
        Found in src/Runtime/Attribute/AttributeValuePath.php - About 1 hr to fix

          Method fake has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function fake(EntityInterface $entity, array $options = array())
              {
                  if (!empty($options[self::OPTION_LOCALE])) {
                      $loc = $options[self::OPTION_LOCALE];
                      if (!is_string($loc) || !preg_match('#[a-z]{2,6}_[A-Z]{2,6}#', $loc)) {
          Severity: Minor
          Found in src/Sham/DataGenerator.php - About 1 hr to fix

            Method execute has 38 lines of code (exceeds 25 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

              Method getUsedReferenceDefinitions has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getUsedReferenceDefinitions(EntityTypeDefinition $type_definition)
                  {
                      $reference_definitions_list = new EntityTypeDefinitionList();
                      $reference_attributes = $type_definition->getAttributes()->filterByType('entity-reference-list');
                      foreach ($reference_attributes as $reference_attribute) {
              Severity: Minor
              Found in src/CodeGen/Schema/EntityTypeSchema.php - About 1 hr to fix

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

                    protected function execute($values, EntityInterface $entity = null)
                    {
                        if (!is_array($values)) {
                            $this->throwError('non_array_value', [], IncidentInterface::CRITICAL);
                            return false;
                Severity: Minor
                Found in src/Runtime/Attribute/TextList/TextListRule.php - About 1 hr to fix

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

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

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

                        protected function execute($value, EntityInterface $parent_entity = null)
                        {
                            $success = true;
                            $list = null;
                    
                    
                    Severity: Minor
                    Found in src/Runtime/Attribute/EmbeddedEntityList/EmbeddedEntityListRule.php - About 1 hr to fix

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

                          protected function execute($value, EntityInterface $parent_entity = null)
                          {
                              $success = true;
                              $list = null;
                      
                      
                      Severity: Minor
                      Found in src/Runtime/Attribute/EmbeddedEntityList/EmbeddedEntityListRule.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 deployFiles has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected function deployFiles(ClassContainerList $class_containers, $method = 'move')
                          {
                              foreach ($class_containers as $class_container) {
                                  $cache_package_dir = $this->buildPackageDirPath($class_container, $this->cache_directory);
                                  $cache_filepath = $cache_package_dir . DIRECTORY_SEPARATOR . $class_container->getFileName();
                      Severity: Minor
                      Found in src/CodeGen/ClassBuilder/BuildCache.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 castArray has a Cognitive Complexity of 12 (exceeds 5 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

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

                          protected function execute($value, EntityInterface $entity = null)
                          {
                              if (!is_string($value)) {
                                  $this->throwError('invalid_type', []);
                                  return false;
                      Severity: Minor
                      Found in src/Runtime/Validator/Rule/Type/TokenRule.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 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
                        Severity
                        Category
                        Status
                        Source
                        Language